private void testCase(String testCaseName) throws SchemaConversionException, DataConversionException { JsonObject test = testCases.get(testCaseName).getAsJsonObject(); parquetConverter = new JsonIntermediateToParquetGroupConverter(); MessageType schema = parquetConverter.convertSchema(test.get("schema").getAsJsonArray(), workUnit); Group record = parquetConverter.convertRecord(schema, test.get("record").getAsJsonObject(), workUnit).iterator().next(); assertEqualsIgnoreSpaces(schema.toString(), test.get("expectedSchema").getAsString()); assertEqualsIgnoreSpaces(record.toString(), test.get("expectedRecord").getAsString()); }
public static void setSchema(final MessageType schema, final Configuration configuration) { configuration.set(PARQUET_HIVE_SCHEMA, schema.toString()); }
public static void setSchema(MessageType schema, Configuration configuration) { configuration.set(PARQUET_EXAMPLE_SCHEMA, schema.toString()); }
@Test public void testSchema() { assertEquals(schemaString, schema.toString()); }
fileBlockLocations, fileStatus, readContext.getRequestedSchema().toString(), readContext.getReadSupportMetadata(), minSplitSize,
@Test public void testNestedTypes() { MessageType schema = MessageTypeParser.parseMessageType(Paper.schema.toString()); Type type = schema.getType("Links", "Backward"); assertEquals(PrimitiveTypeName.INT64, type.asPrimitiveType().getPrimitiveTypeName()); assertEquals(0, schema.getMaxRepetitionLevel("DocId")); assertEquals(1, schema.getMaxRepetitionLevel("Name")); assertEquals(2, schema.getMaxRepetitionLevel("Name", "Language")); assertEquals(0, schema.getMaxDefinitionLevel("DocId")); assertEquals(1, schema.getMaxDefinitionLevel("Links")); assertEquals(2, schema.getMaxDefinitionLevel("Links", "Backward")); } }