You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/05/18 02:21:14 UTC
[GitHub] [flink] wangwei1025 opened a new pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
wangwei1025 opened a new pull request #15939:
URL: https://github.com/apache/flink/pull/15939
<!--
*Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
*Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
## Contribution Checklist
- Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
- Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
- Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
- Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Azure Pipelines CI to do that following [this guide](https://cwiki.apache.org/confluence/display/FLINK/Azure+Pipelines#AzurePipelines-Tutorial:SettingupAzurePipelinesforaforkoftheFlinkrepository).
- Each pull request should address only one issue, not mix up code from multiple issues.
- Each commit in the pull request has a meaningful commit message (including the JIRA id)
- Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
**(The sections below can be removed for hotfixes of typos)**
-->
## What is the purpose of the change
*This pull request support vectorized orc reader with nested types (List/Map/Struct).*
## Brief change log
- *Add OrcArrayColumnVector,OrcMapColumnVector,OrcRowColumnVector to support vectorized orc reader with nested types *
- *Add ColumnarMapData to support map type data*
## Verifying this change
*(Please pick either of the following options)*
This change is a trivial rework / code cleanup without any test coverage.
*(or)*
This change is already covered by existing tests, such as *(please describe tests)*.
*(or)*
This change added tests and can be verified as follows:
- *Add integration tests (OrcFileSystemITCase.testNestedTypes) that validate orc connector support List/Map/Struct types in SQL*
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (yes / no)no
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / no)no
- The serializers: (yes / no / don't know)no
- The runtime per-record code paths (performance sensitive): (yes / no / don't know)no
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (yes / no / don't know)no
- The S3 file system connector: (yes / no / don't know)no
## Documentation
- Does this pull request introduce a new feature? (yes / no) no
- If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-842780777
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "605cdc74e9e601e47c941403361470384dafeaf0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18059",
"triggerID" : "605cdc74e9e601e47c941403361470384dafeaf0",
"triggerType" : "PUSH"
}, {
"hash" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18362",
"triggerID" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"triggerType" : "PUSH"
}, {
"hash" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18378",
"triggerID" : "850051804",
"triggerType" : "MANUAL"
}, {
"hash" : "93f366fbf6903497de905af221de89c8b4ca702b",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18382",
"triggerID" : "93f366fbf6903497de905af221de89c8b4ca702b",
"triggerType" : "PUSH"
}, {
"hash" : "93f366fbf6903497de905af221de89c8b4ca702b",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18386",
"triggerID" : "850222748",
"triggerType" : "MANUAL"
} ]
}-->
## CI report:
* 03c82429912de4c41a2114707ebdb4ad977387bc Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18362) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18378)
* 93f366fbf6903497de905af221de89c8b4ca702b Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18382) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18386)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-842774944
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.
## Automated Checks
Last check on commit 605cdc74e9e601e47c941403361470384dafeaf0 (Tue May 18 02:23:05 UTC 2021)
**Warnings:**
* No documentation files were touched! Remember to keep the Flink docs up to date!
<sub>Mention the bot in a comment to re-run the automated checks.</sub>
## Review Progress
* ❓ 1. The [description] looks good.
* ❓ 2. There is [consensus] that the contribution should go into to Flink.
* ❓ 3. Needs [attention] from.
* ❓ 4. The change fits into the overall [architecture].
* ❓ 5. Overall code [quality] is good.
Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
- `@flinkbot approve all` to approve all aspects
- `@flinkbot approve-until architecture` to approve everything until `architecture`
- `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
- `@flinkbot disapprove architecture` to remove an approval you gave earlier
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on a change in pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on a change in pull request #15939:
URL: https://github.com/apache/flink/pull/15939#discussion_r640348545
##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/data/ColumnarMapData.java
##########
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data;
+
+import org.apache.flink.table.data.vector.ColumnVector;
+
+/** Columnar map to support access to vector column data. */
+public final class ColumnarMapData implements MapData {
+
+ private final ColumnVector keyColumnVector;
+ private final ColumnVector valueColumnVector;
+ private final int offset;
+ private final int numElements;
+
+ public ColumnarMapData(
+ ColumnVector keyColumnVector,
+ ColumnVector valueColumnVector,
+ int offset,
+ int numElements) {
+ this.keyColumnVector = keyColumnVector;
+ this.valueColumnVector = valueColumnVector;
+ this.offset = offset;
+ this.numElements = numElements;
+ }
+
+ @Override
+ public int size() {
+ return numElements;
+ }
+
+ @Override
+ public ArrayData keyArray() {
+ return new ColumnarArrayData(keyColumnVector, offset, numElements);
+ }
+
+ @Override
+ public ArrayData valueArray() {
+ return new ColumnarArrayData(valueColumnVector, offset, numElements);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ throw new UnsupportedOperationException(
Review comment:
I don't support _equals_ and _hashCode_ because ColumnarRowData and ColumnarArrayData don't support it. And I think it's appropriate because ColumnarData don't actually decode data from vector before reading data.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-852642901
@lirui-apache can you help me review again ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] lirui-apache commented on a change in pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
lirui-apache commented on a change in pull request #15939:
URL: https://github.com/apache/flink/pull/15939#discussion_r636891521
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcArrayColumnVector.java
##########
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.ColumnarArrayData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.types.logical.ArrayType;
+
+import org.apache.hadoop.hive.ql.exec.vector.ListColumnVector;
+
+/** This column vector is used to adapt hive's ListColumnVector to Flink's ArrayColumnVector. */
+public class OrcArrayColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.ArrayColumnVector {
+
+ private ListColumnVector hiveVector;
+ private ArrayType type;
Review comment:
I don't see how this field is used
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcArrayColumnVector.java
##########
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.ColumnarArrayData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.types.logical.ArrayType;
+
+import org.apache.hadoop.hive.ql.exec.vector.ListColumnVector;
+
+/** This column vector is used to adapt hive's ListColumnVector to Flink's ArrayColumnVector. */
+public class OrcArrayColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.ArrayColumnVector {
+
+ private ListColumnVector hiveVector;
+ private ArrayType type;
+ private ColumnVector flinkVector;
Review comment:
Make it final
##########
File path: flink-formats/flink-orc/src/test/java/org/apache/flink/orc/OrcFileSystemITCase.java
##########
@@ -164,4 +167,40 @@ public void testOrcFilterPushDown() throws ExecutionException, InterruptedExcept
"select x, y from orcFilterTable where g = timestamp '2020-01-01 05:20:00' and x = 'x10'",
Collections.singletonList(Row.of("x10", "10")));
}
+
+ @Test
+ public void testNestedTypes() throws ExecutionException, InterruptedException {
+ String path =
+ this.getClass().getClassLoader().getResource("test-data-nested.orc").getPath();
+ super.tableEnv()
+ .executeSql(
+ String.format(
+ "create table orcNestedTypesTable ("
+ + "boolean1 boolean,"
+ + "byte1 tinyint,"
+ + "short1 smallint,"
+ + "int1 int,"
+ + "long1 bigint,"
+ + "float1 float,"
+ + "double1 double,"
+ + "string1 string,"
+ + "middle ROW<list ARRAY<ROW<int1 int,string1 string>>>,"
+ + "list ARRAY<ROW<int1 int,string1 string>>,"
+ + "map MAP<string,ROW<int1 int,string1 string>>"
+ + ") with ("
+ + "'connector' = 'filesystem',"
+ + "'format' = 'orc',"
+ + "'path' = '%s')",
+ path));
+
+ TableResult tableResult = super.tableEnv().executeSql("SELECT * FROM orcNestedTypesTable");
+ List<Row> rows = new ArrayList<>();
+ tableResult.collect().forEachRemaining(rows::add);
+ assertEquals(
Review comment:
Let's also verify the number of rows.
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcArrayColumnVector.java
##########
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.ColumnarArrayData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.types.logical.ArrayType;
+
+import org.apache.hadoop.hive.ql.exec.vector.ListColumnVector;
+
+/** This column vector is used to adapt hive's ListColumnVector to Flink's ArrayColumnVector. */
+public class OrcArrayColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.ArrayColumnVector {
+
+ private ListColumnVector hiveVector;
Review comment:
make it final
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcMapColumnVector.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ColumnarMapData;
+import org.apache.flink.table.data.MapData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.types.logical.MapType;
+
+import org.apache.hadoop.hive.ql.exec.vector.MapColumnVector;
+
+/** This column vector is used to adapt hive's MapColumnVector to Flink's MapColumnVector. */
+public class OrcMapColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.MapColumnVector {
+
+ private MapColumnVector hiveVector;
Review comment:
It can be final
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcMapColumnVector.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ColumnarMapData;
+import org.apache.flink.table.data.MapData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.types.logical.MapType;
+
+import org.apache.hadoop.hive.ql.exec.vector.MapColumnVector;
+
+/** This column vector is used to adapt hive's MapColumnVector to Flink's MapColumnVector. */
+public class OrcMapColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.MapColumnVector {
+
+ private MapColumnVector hiveVector;
+ private MapType type;
Review comment:
Is this needed?
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcRowColumnVector.java
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ColumnarRowData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.data.vector.VectorizedColumnBatch;
+import org.apache.flink.table.types.logical.RowType;
+
+import org.apache.hadoop.hive.ql.exec.vector.StructColumnVector;
+
+/** This column vector is used to adapt hive's StructColumnVector to Flink's RowColumnVector. */
+public class OrcRowColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.RowColumnVector {
+
+ private StructColumnVector hiveVector;
+ private RowType type;
+ private VectorizedColumnBatch vectorizedColumnBatch;
Review comment:
Make it final
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcRowColumnVector.java
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ColumnarRowData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.data.vector.VectorizedColumnBatch;
+import org.apache.flink.table.types.logical.RowType;
+
+import org.apache.hadoop.hive.ql.exec.vector.StructColumnVector;
+
+/** This column vector is used to adapt hive's StructColumnVector to Flink's RowColumnVector. */
+public class OrcRowColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.RowColumnVector {
+
+ private StructColumnVector hiveVector;
+ private RowType type;
Review comment:
Are these needed?
##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/data/ColumnarMapData.java
##########
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data;
+
+import org.apache.flink.table.data.vector.ColumnVector;
+
+/** Columnar map to support access to vector column data. */
+public final class ColumnarMapData implements MapData {
+
+ private final ColumnVector keyColumnVector;
+ private final ColumnVector valueColumnVector;
+ private final int offset;
+ private final int numElements;
+
+ public ColumnarMapData(
+ ColumnVector keyColumnVector,
+ ColumnVector valueColumnVector,
+ int offset,
+ int numElements) {
+ this.keyColumnVector = keyColumnVector;
+ this.valueColumnVector = valueColumnVector;
+ this.offset = offset;
+ this.numElements = numElements;
+ }
+
+ @Override
+ public int size() {
+ return numElements;
+ }
+
+ @Override
+ public ArrayData keyArray() {
+ return new ColumnarArrayData(keyColumnVector, offset, numElements);
+ }
+
+ @Override
+ public ArrayData valueArray() {
+ return new ColumnarArrayData(valueColumnVector, offset, numElements);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ throw new UnsupportedOperationException(
Review comment:
Could you explain why we can't support `equals` and `hashCode`?
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcRowColumnVector.java
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ColumnarRowData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.data.vector.VectorizedColumnBatch;
+import org.apache.flink.table.types.logical.RowType;
+
+import org.apache.hadoop.hive.ql.exec.vector.StructColumnVector;
+
+/** This column vector is used to adapt hive's StructColumnVector to Flink's RowColumnVector. */
+public class OrcRowColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.RowColumnVector {
+
+ private StructColumnVector hiveVector;
+ private RowType type;
+ private VectorizedColumnBatch vectorizedColumnBatch;
+
+ public OrcRowColumnVector(StructColumnVector hiveVector, RowType type) {
+ super(hiveVector);
+ this.hiveVector = hiveVector;
+ this.type = type;
+ int len = hiveVector.fields.length;
+ ColumnVector[] flinkVectors = new ColumnVector[len];
+ for (int i = 0; i < len; i++) {
+ flinkVectors[i] = createFlinkVector(hiveVector.fields[i], type.getTypeAt(i));
+ }
+ this.vectorizedColumnBatch = new VectorizedColumnBatch(flinkVectors);
+ }
+
+ @Override
+ public ColumnarRowData getRow(int i) {
+ return new ColumnarRowData(this.vectorizedColumnBatch, i);
Review comment:
Can we cache the `ColumnarRowData` instance and return it with the updated rowId?
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcMapColumnVector.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ColumnarMapData;
+import org.apache.flink.table.data.MapData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.types.logical.MapType;
+
+import org.apache.hadoop.hive.ql.exec.vector.MapColumnVector;
+
+/** This column vector is used to adapt hive's MapColumnVector to Flink's MapColumnVector. */
+public class OrcMapColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.MapColumnVector {
+
+ private MapColumnVector hiveVector;
+ private MapType type;
+ private ColumnVector keyFlinkVector;
+ private ColumnVector valueFlinkVector;
Review comment:
Make them final
##########
File path: flink-formats/flink-orc/src/test/java/org/apache/flink/orc/OrcFileSystemITCase.java
##########
@@ -164,4 +167,40 @@ public void testOrcFilterPushDown() throws ExecutionException, InterruptedExcept
"select x, y from orcFilterTable where g = timestamp '2020-01-01 05:20:00' and x = 'x10'",
Collections.singletonList(Row.of("x10", "10")));
}
+
+ @Test
+ public void testNestedTypes() throws ExecutionException, InterruptedException {
+ String path =
+ this.getClass().getClassLoader().getResource("test-data-nested.orc").getPath();
+ super.tableEnv()
+ .executeSql(
+ String.format(
+ "create table orcNestedTypesTable ("
+ + "boolean1 boolean,"
+ + "byte1 tinyint,"
+ + "short1 smallint,"
+ + "int1 int,"
+ + "long1 bigint,"
+ + "float1 float,"
+ + "double1 double,"
+ + "string1 string,"
+ + "middle ROW<list ARRAY<ROW<int1 int,string1 string>>>,"
+ + "list ARRAY<ROW<int1 int,string1 string>>,"
+ + "map MAP<string,ROW<int1 int,string1 string>>"
+ + ") with ("
+ + "'connector' = 'filesystem',"
+ + "'format' = 'orc',"
+ + "'path' = '%s')",
+ path));
+
+ TableResult tableResult = super.tableEnv().executeSql("SELECT * FROM orcNestedTypesTable");
+ List<Row> rows = new ArrayList<>();
+ tableResult.collect().forEachRemaining(rows::add);
+ assertEquals(
+ "+I[false, 1, 1024, 65536, 9223372036854775807, 1.0, -15.0, hi, +I[[+I[1, bye], +I[2, sigh]]], [+I[3, good], +I[4, bad]], {}]",
Review comment:
Can we also add test for empty arrays, and null values?
##########
File path: flink-formats/flink-orc/src/test/java/org/apache/flink/orc/OrcFileSystemITCase.java
##########
@@ -164,4 +167,40 @@ public void testOrcFilterPushDown() throws ExecutionException, InterruptedExcept
"select x, y from orcFilterTable where g = timestamp '2020-01-01 05:20:00' and x = 'x10'",
Collections.singletonList(Row.of("x10", "10")));
}
+
+ @Test
+ public void testNestedTypes() throws ExecutionException, InterruptedException {
+ String path =
+ this.getClass().getClassLoader().getResource("test-data-nested.orc").getPath();
+ super.tableEnv()
+ .executeSql(
+ String.format(
+ "create table orcNestedTypesTable ("
+ + "boolean1 boolean,"
+ + "byte1 tinyint,"
+ + "short1 smallint,"
+ + "int1 int,"
+ + "long1 bigint,"
+ + "float1 float,"
+ + "double1 double,"
+ + "string1 string,"
+ + "middle ROW<list ARRAY<ROW<int1 int,string1 string>>>,"
+ + "list ARRAY<ROW<int1 int,string1 string>>,"
+ + "map MAP<string,ROW<int1 int,string1 string>>"
+ + ") with ("
+ + "'connector' = 'filesystem',"
+ + "'format' = 'orc',"
+ + "'path' = '%s')",
+ path));
+
+ TableResult tableResult = super.tableEnv().executeSql("SELECT * FROM orcNestedTypesTable");
+ List<Row> rows = new ArrayList<>();
+ tableResult.collect().forEachRemaining(rows::add);
Review comment:
Just use `CollectionUtil.iteratorToList`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-842780777
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "605cdc74e9e601e47c941403361470384dafeaf0",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18059",
"triggerID" : "605cdc74e9e601e47c941403361470384dafeaf0",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 605cdc74e9e601e47c941403361470384dafeaf0 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18059)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on a change in pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on a change in pull request #15939:
URL: https://github.com/apache/flink/pull/15939#discussion_r640354958
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcRowColumnVector.java
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ColumnarRowData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.data.vector.VectorizedColumnBatch;
+import org.apache.flink.table.types.logical.RowType;
+
+import org.apache.hadoop.hive.ql.exec.vector.StructColumnVector;
+
+/** This column vector is used to adapt hive's StructColumnVector to Flink's RowColumnVector. */
+public class OrcRowColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.RowColumnVector {
+
+ private StructColumnVector hiveVector;
+ private RowType type;
Review comment:
removed unused field
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on a change in pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on a change in pull request #15939:
URL: https://github.com/apache/flink/pull/15939#discussion_r640354161
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcArrayColumnVector.java
##########
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.ColumnarArrayData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.types.logical.ArrayType;
+
+import org.apache.hadoop.hive.ql.exec.vector.ListColumnVector;
+
+/** This column vector is used to adapt hive's ListColumnVector to Flink's ArrayColumnVector. */
+public class OrcArrayColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.ArrayColumnVector {
+
+ private ListColumnVector hiveVector;
+ private ArrayType type;
Review comment:
removed unused field
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] lirui-apache commented on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
lirui-apache commented on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-855537630
> @lirui-apache @wangwei1025 Do we need update document and update Hive reader?
Yes, we can have a separate PR for that. @wangwei1025 do you want to work on it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-842774944
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.
## Automated Checks
Last check on commit 93f366fbf6903497de905af221de89c8b4ca702b (Fri May 28 11:11:41 UTC 2021)
**Warnings:**
* No documentation files were touched! Remember to keep the Flink docs up to date!
<sub>Mention the bot in a comment to re-run the automated checks.</sub>
## Review Progress
* ❓ 1. The [description] looks good.
* ❓ 2. There is [consensus] that the contribution should go into to Flink.
* ❓ 3. Needs [attention] from.
* ❓ 4. The change fits into the overall [architecture].
* ❓ 5. Overall code [quality] is good.
Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
- `@flinkbot approve all` to approve all aspects
- `@flinkbot approve-until architecture` to approve everything until `architecture`
- `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
- `@flinkbot disapprove architecture` to remove an approval you gave earlier
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-842780777
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "605cdc74e9e601e47c941403361470384dafeaf0",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "605cdc74e9e601e47c941403361470384dafeaf0",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 605cdc74e9e601e47c941403361470384dafeaf0 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-850222748
@flinkbot run azure
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-842780777
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "605cdc74e9e601e47c941403361470384dafeaf0",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18059",
"triggerID" : "605cdc74e9e601e47c941403361470384dafeaf0",
"triggerType" : "PUSH"
}, {
"hash" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 605cdc74e9e601e47c941403361470384dafeaf0 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18059)
* 03c82429912de4c41a2114707ebdb4ad977387bc UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JingsongLi commented on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
JingsongLi commented on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-842914830
CC: @lirui-apache
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on a change in pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on a change in pull request #15939:
URL: https://github.com/apache/flink/pull/15939#discussion_r640354496
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcMapColumnVector.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ColumnarMapData;
+import org.apache.flink.table.data.MapData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.types.logical.MapType;
+
+import org.apache.hadoop.hive.ql.exec.vector.MapColumnVector;
+
+/** This column vector is used to adapt hive's MapColumnVector to Flink's MapColumnVector. */
+public class OrcMapColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.MapColumnVector {
+
+ private MapColumnVector hiveVector;
+ private MapType type;
Review comment:
removed unused field
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on a change in pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on a change in pull request #15939:
URL: https://github.com/apache/flink/pull/15939#discussion_r640349294
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcArrayColumnVector.java
##########
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.ColumnarArrayData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.types.logical.ArrayType;
+
+import org.apache.hadoop.hive.ql.exec.vector.ListColumnVector;
+
+/** This column vector is used to adapt hive's ListColumnVector to Flink's ArrayColumnVector. */
+public class OrcArrayColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.ArrayColumnVector {
+
+ private ListColumnVector hiveVector;
Review comment:
append final
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-842881614
Hello @JingsongLi , could you please help me review this PR? thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-850051804
@flinkbot run azure
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on a change in pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on a change in pull request #15939:
URL: https://github.com/apache/flink/pull/15939#discussion_r640354361
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcArrayColumnVector.java
##########
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.ColumnarArrayData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.types.logical.ArrayType;
+
+import org.apache.hadoop.hive.ql.exec.vector.ListColumnVector;
+
+/** This column vector is used to adapt hive's ListColumnVector to Flink's ArrayColumnVector. */
+public class OrcArrayColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.ArrayColumnVector {
+
+ private ListColumnVector hiveVector;
+ private ArrayType type;
+ private ColumnVector flinkVector;
Review comment:
append final
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on a change in pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on a change in pull request #15939:
URL: https://github.com/apache/flink/pull/15939#discussion_r640348545
##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/data/ColumnarMapData.java
##########
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data;
+
+import org.apache.flink.table.data.vector.ColumnVector;
+
+/** Columnar map to support access to vector column data. */
+public final class ColumnarMapData implements MapData {
+
+ private final ColumnVector keyColumnVector;
+ private final ColumnVector valueColumnVector;
+ private final int offset;
+ private final int numElements;
+
+ public ColumnarMapData(
+ ColumnVector keyColumnVector,
+ ColumnVector valueColumnVector,
+ int offset,
+ int numElements) {
+ this.keyColumnVector = keyColumnVector;
+ this.valueColumnVector = valueColumnVector;
+ this.offset = offset;
+ this.numElements = numElements;
+ }
+
+ @Override
+ public int size() {
+ return numElements;
+ }
+
+ @Override
+ public ArrayData keyArray() {
+ return new ColumnarArrayData(keyColumnVector, offset, numElements);
+ }
+
+ @Override
+ public ArrayData valueArray() {
+ return new ColumnarArrayData(valueColumnVector, offset, numElements);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ throw new UnsupportedOperationException(
Review comment:
I don't support _equals_ and _hashCode_ because ColumnarRowData don't support it either. And I think it's appropriate because ColumnarRowData don't actually decode data from vector before reading data.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 edited a comment on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 edited a comment on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-878891426
> > @lirui-apache @wangwei1025 Do we need update document and update Hive reader?
>
> Yes, we can have a separate PR for that. @wangwei1025 do you want to work on it?
@lirui-apache @JingsongLi
Sorry to replay so late, I can work on it. Does this has related issus on jira ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-842780777
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "605cdc74e9e601e47c941403361470384dafeaf0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18059",
"triggerID" : "605cdc74e9e601e47c941403361470384dafeaf0",
"triggerType" : "PUSH"
}, {
"hash" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18362",
"triggerID" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"triggerType" : "PUSH"
}, {
"hash" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18378",
"triggerID" : "850051804",
"triggerType" : "MANUAL"
}, {
"hash" : "93f366fbf6903497de905af221de89c8b4ca702b",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18382",
"triggerID" : "93f366fbf6903497de905af221de89c8b4ca702b",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 03c82429912de4c41a2114707ebdb4ad977387bc Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18362) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18378)
* 93f366fbf6903497de905af221de89c8b4ca702b Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18382)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JingsongLi commented on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
JingsongLi commented on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-855533615
@lirui-apache @wangwei1025 Do we need update document and update Hive reader?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-842774944
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.
## Automated Checks
Last check on commit 93f366fbf6903497de905af221de89c8b4ca702b (Tue Dec 14 09:05:31 UTC 2021)
**Warnings:**
* No documentation files were touched! Remember to keep the Flink docs up to date!
<sub>Mention the bot in a comment to re-run the automated checks.</sub>
## Review Progress
* ❓ 1. The [description] looks good.
* ❓ 2. There is [consensus] that the contribution should go into to Flink.
* ❓ 3. Needs [attention] from.
* ❓ 4. The change fits into the overall [architecture].
* ❓ 5. Overall code [quality] is good.
Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
- `@flinkbot approve all` to approve all aspects
- `@flinkbot approve-until architecture` to approve everything until `architecture`
- `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
- `@flinkbot disapprove architecture` to remove an approval you gave earlier
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on a change in pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on a change in pull request #15939:
URL: https://github.com/apache/flink/pull/15939#discussion_r640348545
##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/data/ColumnarMapData.java
##########
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data;
+
+import org.apache.flink.table.data.vector.ColumnVector;
+
+/** Columnar map to support access to vector column data. */
+public final class ColumnarMapData implements MapData {
+
+ private final ColumnVector keyColumnVector;
+ private final ColumnVector valueColumnVector;
+ private final int offset;
+ private final int numElements;
+
+ public ColumnarMapData(
+ ColumnVector keyColumnVector,
+ ColumnVector valueColumnVector,
+ int offset,
+ int numElements) {
+ this.keyColumnVector = keyColumnVector;
+ this.valueColumnVector = valueColumnVector;
+ this.offset = offset;
+ this.numElements = numElements;
+ }
+
+ @Override
+ public int size() {
+ return numElements;
+ }
+
+ @Override
+ public ArrayData keyArray() {
+ return new ColumnarArrayData(keyColumnVector, offset, numElements);
+ }
+
+ @Override
+ public ArrayData valueArray() {
+ return new ColumnarArrayData(valueColumnVector, offset, numElements);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ throw new UnsupportedOperationException(
Review comment:
I don't support _equals_ and _hashCode_ because ColumnarRowData and ColumnarArrayData don't support it. And I think it's appropriate because ColumnarRowData don't decode data from vector before reading data.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on a change in pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on a change in pull request #15939:
URL: https://github.com/apache/flink/pull/15939#discussion_r640354643
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcMapColumnVector.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ColumnarMapData;
+import org.apache.flink.table.data.MapData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.types.logical.MapType;
+
+import org.apache.hadoop.hive.ql.exec.vector.MapColumnVector;
+
+/** This column vector is used to adapt hive's MapColumnVector to Flink's MapColumnVector. */
+public class OrcMapColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.MapColumnVector {
+
+ private MapColumnVector hiveVector;
Review comment:
append final
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcMapColumnVector.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ColumnarMapData;
+import org.apache.flink.table.data.MapData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.types.logical.MapType;
+
+import org.apache.hadoop.hive.ql.exec.vector.MapColumnVector;
+
+/** This column vector is used to adapt hive's MapColumnVector to Flink's MapColumnVector. */
+public class OrcMapColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.MapColumnVector {
+
+ private MapColumnVector hiveVector;
+ private MapType type;
+ private ColumnVector keyFlinkVector;
+ private ColumnVector valueFlinkVector;
Review comment:
append final
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcRowColumnVector.java
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ColumnarRowData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.data.vector.VectorizedColumnBatch;
+import org.apache.flink.table.types.logical.RowType;
+
+import org.apache.hadoop.hive.ql.exec.vector.StructColumnVector;
+
+/** This column vector is used to adapt hive's StructColumnVector to Flink's RowColumnVector. */
+public class OrcRowColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.RowColumnVector {
+
+ private StructColumnVector hiveVector;
+ private RowType type;
Review comment:
removed unsed field
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-878891426
> > @lirui-apache @wangwei1025 Do we need update document and update Hive reader?
>
> Yes, we can have a separate PR for that. @wangwei1025 do you want to work on it?
Sorry to replay so late, I can work on it. Does this has related issus on jira ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-842780777
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "605cdc74e9e601e47c941403361470384dafeaf0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18059",
"triggerID" : "605cdc74e9e601e47c941403361470384dafeaf0",
"triggerType" : "PUSH"
}, {
"hash" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18362",
"triggerID" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"triggerType" : "PUSH"
}, {
"hash" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18378",
"triggerID" : "850051804",
"triggerType" : "MANUAL"
}, {
"hash" : "93f366fbf6903497de905af221de89c8b4ca702b",
"status" : "CANCELED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18382",
"triggerID" : "93f366fbf6903497de905af221de89c8b4ca702b",
"triggerType" : "PUSH"
}, {
"hash" : "93f366fbf6903497de905af221de89c8b4ca702b",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18386",
"triggerID" : "850222748",
"triggerType" : "MANUAL"
}, {
"hash" : "93f366fbf6903497de905af221de89c8b4ca702b",
"status" : "CANCELED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18382",
"triggerID" : "850222748",
"triggerType" : "MANUAL"
} ]
}-->
## CI report:
* 93f366fbf6903497de905af221de89c8b4ca702b Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18386) Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18382)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-842780777
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "605cdc74e9e601e47c941403361470384dafeaf0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18059",
"triggerID" : "605cdc74e9e601e47c941403361470384dafeaf0",
"triggerType" : "PUSH"
}, {
"hash" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18362",
"triggerID" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"triggerType" : "PUSH"
}, {
"hash" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18378",
"triggerID" : "850051804",
"triggerType" : "MANUAL"
} ]
}-->
## CI report:
* 03c82429912de4c41a2114707ebdb4ad977387bc Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18362) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18378)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on a change in pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on a change in pull request #15939:
URL: https://github.com/apache/flink/pull/15939#discussion_r640354161
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcArrayColumnVector.java
##########
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.ColumnarArrayData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.types.logical.ArrayType;
+
+import org.apache.hadoop.hive.ql.exec.vector.ListColumnVector;
+
+/** This column vector is used to adapt hive's ListColumnVector to Flink's ArrayColumnVector. */
+public class OrcArrayColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.ArrayColumnVector {
+
+ private ListColumnVector hiveVector;
+ private ArrayType type;
Review comment:
removed unsed field
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] lirui-apache closed pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
lirui-apache closed pull request #15939:
URL: https://github.com/apache/flink/pull/15939
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on a change in pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on a change in pull request #15939:
URL: https://github.com/apache/flink/pull/15939#discussion_r640355678
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcRowColumnVector.java
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ColumnarRowData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.data.vector.VectorizedColumnBatch;
+import org.apache.flink.table.types.logical.RowType;
+
+import org.apache.hadoop.hive.ql.exec.vector.StructColumnVector;
+
+/** This column vector is used to adapt hive's StructColumnVector to Flink's RowColumnVector. */
+public class OrcRowColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.RowColumnVector {
+
+ private StructColumnVector hiveVector;
+ private RowType type;
+ private VectorizedColumnBatch vectorizedColumnBatch;
Review comment:
append final
##########
File path: flink-formats/flink-orc/src/test/java/org/apache/flink/orc/OrcFileSystemITCase.java
##########
@@ -164,4 +167,40 @@ public void testOrcFilterPushDown() throws ExecutionException, InterruptedExcept
"select x, y from orcFilterTable where g = timestamp '2020-01-01 05:20:00' and x = 'x10'",
Collections.singletonList(Row.of("x10", "10")));
}
+
+ @Test
+ public void testNestedTypes() throws ExecutionException, InterruptedException {
+ String path =
+ this.getClass().getClassLoader().getResource("test-data-nested.orc").getPath();
+ super.tableEnv()
+ .executeSql(
+ String.format(
+ "create table orcNestedTypesTable ("
+ + "boolean1 boolean,"
+ + "byte1 tinyint,"
+ + "short1 smallint,"
+ + "int1 int,"
+ + "long1 bigint,"
+ + "float1 float,"
+ + "double1 double,"
+ + "string1 string,"
+ + "middle ROW<list ARRAY<ROW<int1 int,string1 string>>>,"
+ + "list ARRAY<ROW<int1 int,string1 string>>,"
+ + "map MAP<string,ROW<int1 int,string1 string>>"
+ + ") with ("
+ + "'connector' = 'filesystem',"
+ + "'format' = 'orc',"
+ + "'path' = '%s')",
+ path));
+
+ TableResult tableResult = super.tableEnv().executeSql("SELECT * FROM orcNestedTypesTable");
+ List<Row> rows = new ArrayList<>();
+ tableResult.collect().forEachRemaining(rows::add);
Review comment:
fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-842780777
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "605cdc74e9e601e47c941403361470384dafeaf0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18059",
"triggerID" : "605cdc74e9e601e47c941403361470384dafeaf0",
"triggerType" : "PUSH"
}, {
"hash" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18362",
"triggerID" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"triggerType" : "PUSH"
}, {
"hash" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18378",
"triggerID" : "850051804",
"triggerType" : "MANUAL"
}, {
"hash" : "93f366fbf6903497de905af221de89c8b4ca702b",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "93f366fbf6903497de905af221de89c8b4ca702b",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 03c82429912de4c41a2114707ebdb4ad977387bc Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18362) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18378)
* 93f366fbf6903497de905af221de89c8b4ca702b UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on a change in pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on a change in pull request #15939:
URL: https://github.com/apache/flink/pull/15939#discussion_r640354496
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcMapColumnVector.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ColumnarMapData;
+import org.apache.flink.table.data.MapData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.types.logical.MapType;
+
+import org.apache.hadoop.hive.ql.exec.vector.MapColumnVector;
+
+/** This column vector is used to adapt hive's MapColumnVector to Flink's MapColumnVector. */
+public class OrcMapColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.MapColumnVector {
+
+ private MapColumnVector hiveVector;
+ private MapType type;
Review comment:
removed unsed field
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on a change in pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on a change in pull request #15939:
URL: https://github.com/apache/flink/pull/15939#discussion_r640356024
##########
File path: flink-formats/flink-orc/src/test/java/org/apache/flink/orc/OrcFileSystemITCase.java
##########
@@ -164,4 +167,40 @@ public void testOrcFilterPushDown() throws ExecutionException, InterruptedExcept
"select x, y from orcFilterTable where g = timestamp '2020-01-01 05:20:00' and x = 'x10'",
Collections.singletonList(Row.of("x10", "10")));
}
+
+ @Test
+ public void testNestedTypes() throws ExecutionException, InterruptedException {
+ String path =
+ this.getClass().getClassLoader().getResource("test-data-nested.orc").getPath();
+ super.tableEnv()
+ .executeSql(
+ String.format(
+ "create table orcNestedTypesTable ("
+ + "boolean1 boolean,"
+ + "byte1 tinyint,"
+ + "short1 smallint,"
+ + "int1 int,"
+ + "long1 bigint,"
+ + "float1 float,"
+ + "double1 double,"
+ + "string1 string,"
+ + "middle ROW<list ARRAY<ROW<int1 int,string1 string>>>,"
+ + "list ARRAY<ROW<int1 int,string1 string>>,"
+ + "map MAP<string,ROW<int1 int,string1 string>>"
+ + ") with ("
+ + "'connector' = 'filesystem',"
+ + "'format' = 'orc',"
+ + "'path' = '%s')",
+ path));
+
+ TableResult tableResult = super.tableEnv().executeSql("SELECT * FROM orcNestedTypesTable");
+ List<Row> rows = new ArrayList<>();
+ tableResult.collect().forEachRemaining(rows::add);
+ assertEquals(
Review comment:
append number of rows validation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-842780777
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "605cdc74e9e601e47c941403361470384dafeaf0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18059",
"triggerID" : "605cdc74e9e601e47c941403361470384dafeaf0",
"triggerType" : "PUSH"
}, {
"hash" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18362",
"triggerID" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 03c82429912de4c41a2114707ebdb4ad977387bc Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18362)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] lirui-apache commented on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
lirui-apache commented on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-880644159
> > > @lirui-apache @wangwei1025 Do we need update document and update Hive reader?
> >
> >
> > Yes, we can have a separate PR for that. @wangwei1025 do you want to work on it?
>
> @lirui-apache @JingsongLi
> Sorry to replay so late, I can work on it. Does this has related issus on jira ?
Thanks for volunteering to help. I don't think there's a jira ticket for it. Please go ahead to create one.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-845718823
@lirui-apache Hello, could you please help me review this PR? thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-842780777
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "605cdc74e9e601e47c941403361470384dafeaf0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18059",
"triggerID" : "605cdc74e9e601e47c941403361470384dafeaf0",
"triggerType" : "PUSH"
}, {
"hash" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18362",
"triggerID" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"triggerType" : "PUSH"
}, {
"hash" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18378",
"triggerID" : "850051804",
"triggerType" : "MANUAL"
}, {
"hash" : "93f366fbf6903497de905af221de89c8b4ca702b",
"status" : "CANCELED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18382",
"triggerID" : "93f366fbf6903497de905af221de89c8b4ca702b",
"triggerType" : "PUSH"
}, {
"hash" : "93f366fbf6903497de905af221de89c8b4ca702b",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18386",
"triggerID" : "850222748",
"triggerType" : "MANUAL"
}, {
"hash" : "93f366fbf6903497de905af221de89c8b4ca702b",
"status" : "CANCELED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18382",
"triggerID" : "850222748",
"triggerType" : "MANUAL"
} ]
}-->
## CI report:
* 93f366fbf6903497de905af221de89c8b4ca702b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18386) Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18382)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on a change in pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on a change in pull request #15939:
URL: https://github.com/apache/flink/pull/15939#discussion_r640356537
##########
File path: flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/OrcRowColumnVector.java
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.orc.vector;
+
+import org.apache.flink.table.data.ColumnarRowData;
+import org.apache.flink.table.data.vector.ColumnVector;
+import org.apache.flink.table.data.vector.VectorizedColumnBatch;
+import org.apache.flink.table.types.logical.RowType;
+
+import org.apache.hadoop.hive.ql.exec.vector.StructColumnVector;
+
+/** This column vector is used to adapt hive's StructColumnVector to Flink's RowColumnVector. */
+public class OrcRowColumnVector extends AbstractOrcColumnVector
+ implements org.apache.flink.table.data.vector.RowColumnVector {
+
+ private StructColumnVector hiveVector;
+ private RowType type;
+ private VectorizedColumnBatch vectorizedColumnBatch;
+
+ public OrcRowColumnVector(StructColumnVector hiveVector, RowType type) {
+ super(hiveVector);
+ this.hiveVector = hiveVector;
+ this.type = type;
+ int len = hiveVector.fields.length;
+ ColumnVector[] flinkVectors = new ColumnVector[len];
+ for (int i = 0; i < len; i++) {
+ flinkVectors[i] = createFlinkVector(hiveVector.fields[i], type.getTypeAt(i));
+ }
+ this.vectorizedColumnBatch = new VectorizedColumnBatch(flinkVectors);
+ }
+
+ @Override
+ public ColumnarRowData getRow(int i) {
+ return new ColumnarRowData(this.vectorizedColumnBatch, i);
Review comment:
cached ColumnarRowData in constructor
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wangwei1025 commented on a change in pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
wangwei1025 commented on a change in pull request #15939:
URL: https://github.com/apache/flink/pull/15939#discussion_r640356827
##########
File path: flink-formats/flink-orc/src/test/java/org/apache/flink/orc/OrcFileSystemITCase.java
##########
@@ -164,4 +167,40 @@ public void testOrcFilterPushDown() throws ExecutionException, InterruptedExcept
"select x, y from orcFilterTable where g = timestamp '2020-01-01 05:20:00' and x = 'x10'",
Collections.singletonList(Row.of("x10", "10")));
}
+
+ @Test
+ public void testNestedTypes() throws ExecutionException, InterruptedException {
+ String path =
+ this.getClass().getClassLoader().getResource("test-data-nested.orc").getPath();
+ super.tableEnv()
+ .executeSql(
+ String.format(
+ "create table orcNestedTypesTable ("
+ + "boolean1 boolean,"
+ + "byte1 tinyint,"
+ + "short1 smallint,"
+ + "int1 int,"
+ + "long1 bigint,"
+ + "float1 float,"
+ + "double1 double,"
+ + "string1 string,"
+ + "middle ROW<list ARRAY<ROW<int1 int,string1 string>>>,"
+ + "list ARRAY<ROW<int1 int,string1 string>>,"
+ + "map MAP<string,ROW<int1 int,string1 string>>"
+ + ") with ("
+ + "'connector' = 'filesystem',"
+ + "'format' = 'orc',"
+ + "'path' = '%s')",
+ path));
+
+ TableResult tableResult = super.tableEnv().executeSql("SELECT * FROM orcNestedTypesTable");
+ List<Row> rows = new ArrayList<>();
+ tableResult.collect().forEachRemaining(rows::add);
+ assertEquals(
+ "+I[false, 1, 1024, 65536, 9223372036854775807, 1.0, -15.0, hi, +I[[+I[1, bye], +I[2, sigh]]], [+I[3, good], +I[4, bad]], {}]",
Review comment:
Generate a new orc file with empty arrays, and null values
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-842780777
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "605cdc74e9e601e47c941403361470384dafeaf0",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18059",
"triggerID" : "605cdc74e9e601e47c941403361470384dafeaf0",
"triggerType" : "PUSH"
}, {
"hash" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18362",
"triggerID" : "03c82429912de4c41a2114707ebdb4ad977387bc",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 605cdc74e9e601e47c941403361470384dafeaf0 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18059)
* 03c82429912de4c41a2114707ebdb4ad977387bc Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18362)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15939: [FLINK-15390][Connectors/ORC][Connectors/Hive]List/Map/Struct types support for vectorized orc reader
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15939:
URL: https://github.com/apache/flink/pull/15939#issuecomment-842780777
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "605cdc74e9e601e47c941403361470384dafeaf0",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18059",
"triggerID" : "605cdc74e9e601e47c941403361470384dafeaf0",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 605cdc74e9e601e47c941403361470384dafeaf0 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18059)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org