Search in sources :

Example 11 with StringType$

use of org.apache.spark.sql.types.StringType$ in project bunsen by cerner.

the class SchemaConverterTest method codingToStruct.

@Test
public void codingToStruct() {
    DataType codingType = getField(conditionSchema, true, "severity", "coding");
    Assert.assertTrue(getField(codingType, true, "system") instanceof StringType);
    Assert.assertTrue(getField(codingType, true, "version") instanceof StringType);
    Assert.assertTrue(getField(codingType, true, "code") instanceof StringType);
    Assert.assertTrue(getField(codingType, true, "display") instanceof StringType);
    Assert.assertTrue(getField(codingType, true, "userSelected") instanceof BooleanType);
}
Also used : StringType(org.apache.spark.sql.types.StringType) BooleanType(org.apache.spark.sql.types.BooleanType) DataType(org.apache.spark.sql.types.DataType) Test(org.junit.Test)

Example 12 with StringType$

use of org.apache.spark.sql.types.StringType$ in project bunsen by cerner.

the class SchemaConverterTest method codeableConceptToStruct.

@Test
public void codeableConceptToStruct() {
    DataType codeableType = getField(conditionSchema, true, "severity");
    Assert.assertTrue(codeableType instanceof StructType);
    Assert.assertTrue(getField(codeableType, true, "coding") instanceof ArrayType);
    Assert.assertTrue(getField(codeableType, true, "text") instanceof StringType);
}
Also used : ArrayType(org.apache.spark.sql.types.ArrayType) StructType(org.apache.spark.sql.types.StructType) StringType(org.apache.spark.sql.types.StringType) DataType(org.apache.spark.sql.types.DataType) Test(org.junit.Test)

Aggregations

StructType (org.apache.spark.sql.types.StructType)10 StringType (org.apache.spark.sql.types.StringType)9 BooleanType (org.apache.spark.sql.types.BooleanType)7 StructField (org.apache.spark.sql.types.StructField)7 DataType (org.apache.spark.sql.types.DataType)6 ArrayType (org.apache.spark.sql.types.ArrayType)5 DoubleType (org.apache.spark.sql.types.DoubleType)5 List (java.util.List)4 OpenLineage (io.openlineage.client.OpenLineage)3 SparkAgentTestExtension (io.openlineage.spark.agent.SparkAgentTestExtension)3 Path (java.nio.file.Path)3 Optional (java.util.Optional)3 SparkSession (org.apache.spark.sql.SparkSession)3 DateType (org.apache.spark.sql.types.DateType)3 DecimalType (org.apache.spark.sql.types.DecimalType)3 FloatType (org.apache.spark.sql.types.FloatType)3 IntegerType (org.apache.spark.sql.types.IntegerType)3 LongType (org.apache.spark.sql.types.LongType)3 Metadata (org.apache.spark.sql.types.Metadata)3 ShortType (org.apache.spark.sql.types.ShortType)3