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

2017-01-30 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/drill/pull/673


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2016-12-09 Thread Serhii-Harnyk
Github user Serhii-Harnyk commented on a diff in the pull request:

https://github.com/apache/drill/pull/673#discussion_r91753304
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/ParquetFixedWidthDictionaryReaders.java
 ---
@@ -56,6 +58,31 @@ protected void readField(long recordsToReadInThisPass) {
 }
--- End diff --

done


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2016-12-02 Thread parthchandra
Github user parthchandra commented on a diff in the pull request:

https://github.com/apache/drill/pull/673#discussion_r90694935
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/ParquetFixedWidthDictionaryReaders.java
 ---
@@ -56,6 +58,31 @@ protected void readField(long recordsToReadInThisPass) {
 }
--- End diff --

What about NullableDictionaryUint types?
Also, It is probably a good idea to create a single parquet file with 
columns of all combinations of these types, 
Nullable, dictionary encoded, signed and unsigned int2, int4, int8 types 
and a single unit test to read that file.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2016-12-02 Thread parthchandra
Github user parthchandra commented on a diff in the pull request:

https://github.com/apache/drill/pull/673#discussion_r90694144
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/ParquetFixedWidthDictionaryReaders.java
 ---
@@ -56,6 +58,31 @@ protected void readField(long recordsToReadInThisPass) {
 }
   }
 
+  /**
+   * This class uses for reading unsigned integer fields.
+   */
+  static class DictionaryUInt4Reader extends 
FixedByteAlignedReader {
+DictionaryUInt4Reader(ParquetRecordReader parentReader, int 
allocateSize, ColumnDescriptor descriptor,
+ColumnChunkMetaData columnChunkMetaData, boolean 
fixedLength, UInt4Vector v,
+SchemaElement schemaElement) throws 
ExecutionSetupException {
+  super(parentReader, allocateSize, descriptor, columnChunkMetaData, 
fixedLength, v, schemaElement);
+}
+
+// this method is called by its superclass during a read loop
+@Override
+protected void readField(long recordsToReadInThisPass) {
+
+  recordsReadInThisIteration = Math.min(pageReader.currentPageCount
+- pageReader.valuesRead, recordsToReadInThisPass - 
valuesReadInCurrentPass);
+
+  if (usingDictionary) {
+for (int i = 0; i < recordsReadInThisIteration; i++){
+  valueVec.getMutator().setSafe(valuesReadInCurrentPass + i, 
pageReader.dictionaryValueReader.readInteger());
--- End diff --

you probably need to set writer index just as you do in the uint8 case.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2016-12-01 Thread parthchandra
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 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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2016-11-30 Thread Serhii-Harnyk
GitHub user Serhii-Harnyk opened a pull request:

https://github.com/apache/drill/pull/673

DRILL-4764: Parquet file with INT_16, etc. logical types not supporte…

…d by simple SELECT

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/Serhii-Harnyk/drill DRILL-4764

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/drill/pull/673.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #673


commit ef8d7a294e1549eb5fbb61da3aad069a478ffca6
Author: Serhii-Harnyk 
Date:   2016-11-24T13:24:03Z

DRILL-4764: Parquet file with INT_16, etc. logical types not supported by 
simple SELECT




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---