You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by parthchandra <gi...@git.apache.org> on 2016/12/02 01:03:41 UTC

[GitHub] drill pull request #673: DRILL-4764: Parquet file with INT_16, etc. logical ...

Github user parthchandra commented on a diff in the pull request:

    https://github.com/apache/drill/pull/673#discussion_r90570343
  
    --- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet2/TestDrillParquetReader.java ---
    @@ -84,4 +94,43 @@ public void test4349() throws Exception {
           .sqlBaselineQuery("SELECT columns[0] id, CAST(NULLIF(columns[1], '') AS DOUBLE) val FROM cp.`parquet2/4349.csv.gz` WHERE columns[0] = 'b'")
           .go();
       }
    +
    +  @Test
    +  public void testUnsignedByteShortIntLong() throws Exception {
    +    Path file = new Path(getDfsTestTmpSchemaLocation(), "uint_types.parquet");
    +    Configuration conf = new Configuration();
    +    MessageType schema = parseMessageType(
    +      "message test { "
    +        + "required int32 int8_field (INT_8); "
    +        + "required int32 uint8_field (UINT_8); "
    +        + "required int32 int16_field (INT_16); "
    +        + "required int32 uint16_field (UINT_16); "
    +        + "required int32 uint32_field (UINT_32); "
    +        + "required int64 uint64_field (UINT_64); "
    +        +"} ");
    +    GroupWriteSupport.setSchema(schema, conf);
    +
    +    ParquetWriter<Group> writer = ExampleParquetWriter.builder(file)
    +      .withType(schema)
    +      .withConf(conf)
    +      .build();
    +
    +    SimpleGroupFactory groupFactory = new SimpleGroupFactory(schema);
    +    writer.write(
    +      groupFactory.newGroup()
    +        .append("int8_field", -128)
    +        .append("uint8_field", 127)
    +        .append("int16_field", -32768)
    --- End diff --
    
    Can you add test values for unsigned types as well? 0, -1, 256, 65536, etc


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---