You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/06/10 13:22:42 UTC
[GitHub] [iceberg] cmathiesen opened a new pull request #1107: Add IcebergStorageHandler
cmathiesen opened a new pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107
This PR adds an `IcebergStorageHandler` that bundles together all the interfaces needed to read Iceberg table from Hive. This would first require #933 and #1103 to be merged in as it requires the InputFormat and the SerDe classes
We are planning on adding tests using HiveRunner for this class once everything is merged in :D
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] rdsr commented on pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
rdsr commented on pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#issuecomment-643046562
@massdosage @cmathiesen . In what order should we review the work here? #933 , #1103 and then this PR ?
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] massdosage commented on pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
massdosage commented on pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#issuecomment-643309120
Ah, I just realised this actually depends on the InputFormat and SerDe classes being present so we'd actually need #1103 merged first and then should either add this code to #933 or only look at this after that has been merged and then add the HiveRunner tests for the StorageHandler to this PR. So I'd say please look at #1103 first.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] pvary commented on a change in pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
pvary commented on a change in pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#discussion_r459448308
##########
File path: mr/src/main/java/org/apache/iceberg/mr/mapred/IcebergStorageHandler.java
##########
@@ -0,0 +1,115 @@
+/*
+ * 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.iceberg.mr.mapred;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.metastore.HiveMetaHook;
+import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.metadata.HiveStorageHandler;
+import org.apache.hadoop.hive.ql.metadata.HiveStoragePredicateHandler;
+import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
+import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
+import org.apache.hadoop.hive.ql.plan.TableDesc;
+import org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider;
+import org.apache.hadoop.hive.serde2.AbstractSerDe;
+import org.apache.hadoop.hive.serde2.Deserializer;
+import org.apache.hadoop.mapred.InputFormat;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapred.OutputFormat;
+
+public class IcebergStorageHandler implements HiveStoragePredicateHandler, HiveStorageHandler {
+
+ private Configuration conf;
+
+ @Override
+ public Class<? extends InputFormat> getInputFormatClass() {
+ return IcebergInputFormat.class;
+ }
+
+ @Override
+ public Class<? extends OutputFormat> getOutputFormatClass() {
+ return HiveIgnoreKeyTextOutputFormat.class;
+ }
+
+ @Override
+ public Class<? extends AbstractSerDe> getSerDeClass() {
+ return IcebergSerDe.class;
+ }
+
+ @Override
+ public HiveMetaHook getMetaHook() {
+ return null;
+ }
+
+ @Override
+ public HiveAuthorizationProvider getAuthorizationProvider() throws HiveException {
+ return null;
+ }
+
+ @Override
+ public void configureInputJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureOutputJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureTableJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureJobConf(TableDesc tableDesc, JobConf jobConf) {
+
+ }
+
+ @Override
+ public Configuration getConf() {
+ return conf;
+ }
+
+ @Override
+ public void setConf(Configuration conf) {
+ this.conf = conf;
+ }
+ @Override
+ public String toString() {
+ return this.getClass().getName();
+ }
+
+ /**
+ * @param jobConf Job configuration for InputFormat to access
+ * @param deserializer Deserializer
+ * @param exprNodeDesc Filter expression extracted by Hive
+ * @return Entire filter to take advantage of Hive's pruning as well as Iceberg's pruning.
+ */
+ @Override
+ public DecomposedPredicate decomposePredicate(JobConf jobConf, Deserializer deserializer, ExprNodeDesc exprNodeDesc) {
+ DecomposedPredicate predicate = new DecomposedPredicate();
+ predicate.residualPredicate = (ExprNodeGenericFuncDesc) exprNodeDesc;
Review comment:
Sure thing! I will follow the stuff around the HiveSerde and friends :)
As a first implementation it is definitely ok to return the whole expression as a residualPredicate. Hive just have to try to apply that again which is absolutely ok from correctness side.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] rdblue merged pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
rdblue merged pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] massdosage commented on pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
massdosage commented on pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#issuecomment-663579330
> Maybe something like "STORED AS ICEBERG" should help to save the users some time if they are creating the Hive tables manually above existing Iceberg tables. See the same for JSON: https://issues.apache.org/jira/browse/HIVE-19899 - this would need a Hive change after the Iceberg release, but having IcebergStorageFormatDescriptor.java might be a part of the Iceberg project.
That's a great idea, I'll look into it when I get a chance.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] massdosage commented on a change in pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
massdosage commented on a change in pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#discussion_r459439896
##########
File path: mr/src/main/java/org/apache/iceberg/mr/mapred/IcebergStorageHandler.java
##########
@@ -0,0 +1,115 @@
+/*
+ * 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.iceberg.mr.mapred;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.metastore.HiveMetaHook;
+import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.metadata.HiveStorageHandler;
+import org.apache.hadoop.hive.ql.metadata.HiveStoragePredicateHandler;
+import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
+import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
+import org.apache.hadoop.hive.ql.plan.TableDesc;
+import org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider;
+import org.apache.hadoop.hive.serde2.AbstractSerDe;
+import org.apache.hadoop.hive.serde2.Deserializer;
+import org.apache.hadoop.mapred.InputFormat;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapred.OutputFormat;
+
+public class IcebergStorageHandler implements HiveStoragePredicateHandler, HiveStorageHandler {
+
+ private Configuration conf;
+
+ @Override
+ public Class<? extends InputFormat> getInputFormatClass() {
+ return IcebergInputFormat.class;
+ }
+
+ @Override
+ public Class<? extends OutputFormat> getOutputFormatClass() {
+ return HiveIgnoreKeyTextOutputFormat.class;
+ }
+
+ @Override
+ public Class<? extends AbstractSerDe> getSerDeClass() {
+ return IcebergSerDe.class;
+ }
+
+ @Override
+ public HiveMetaHook getMetaHook() {
+ return null;
+ }
+
+ @Override
+ public HiveAuthorizationProvider getAuthorizationProvider() throws HiveException {
+ return null;
+ }
+
+ @Override
+ public void configureInputJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureOutputJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureTableJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureJobConf(TableDesc tableDesc, JobConf jobConf) {
+
+ }
+
+ @Override
+ public Configuration getConf() {
+ return conf;
+ }
+
+ @Override
+ public void setConf(Configuration conf) {
+ this.conf = conf;
+ }
+ @Override
+ public String toString() {
+ return this.getClass().getName();
+ }
+
+ /**
+ * @param jobConf Job configuration for InputFormat to access
+ * @param deserializer Deserializer
+ * @param exprNodeDesc Filter expression extracted by Hive
+ * @return Entire filter to take advantage of Hive's pruning as well as Iceberg's pruning.
+ */
+ @Override
+ public DecomposedPredicate decomposePredicate(JobConf jobConf, Deserializer deserializer, ExprNodeDesc exprNodeDesc) {
+ DecomposedPredicate predicate = new DecomposedPredicate();
+ predicate.residualPredicate = (ExprNodeGenericFuncDesc) exprNodeDesc;
Review comment:
We have some prior work on how we intend to push filters down over [here](https://github.com/ExpediaGroup/hiveberg/pull/11/files#diff-9b0ac6038adb8926dbc1f456a1fddcc9). The intention was to first get this "first implementation" merged in and then raise a subsequent PR to add improvements. I need to update this PR since the InputFormat was merged in (working on it as we speak). We'd definitely appreciate input on the subsequent PRs if there are better ways of interacting with Hive.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] massdosage commented on a change in pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
massdosage commented on a change in pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#discussion_r460004694
##########
File path: mr/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java
##########
@@ -0,0 +1,117 @@
+/*
+ * 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.iceberg.mr.hive;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.metastore.HiveMetaHook;
+import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.metadata.HiveStorageHandler;
+import org.apache.hadoop.hive.ql.metadata.HiveStoragePredicateHandler;
+import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
+import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
+import org.apache.hadoop.hive.ql.plan.TableDesc;
+import org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider;
+import org.apache.hadoop.hive.serde2.AbstractSerDe;
+import org.apache.hadoop.hive.serde2.Deserializer;
+import org.apache.hadoop.mapred.InputFormat;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapred.OutputFormat;
+import org.apache.iceberg.mr.mapred.IcebergSerDe;
+
+public class HiveIcebergStorageHandler implements HiveStoragePredicateHandler, HiveStorageHandler {
+
+ private Configuration conf;
+
+ @Override
+ public Class<? extends InputFormat> getInputFormatClass() {
+ return HiveIcebergInputFormat.class;
+ }
+
+ @Override
+ public Class<? extends OutputFormat> getOutputFormatClass() {
+ return HiveIgnoreKeyTextOutputFormat.class;
Review comment:
Good question, we haven't tried the write path at all but I agree that it would be better if it failed rather than silently doing nothing.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] rdblue commented on a change in pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#discussion_r459804920
##########
File path: mr/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java
##########
@@ -0,0 +1,117 @@
+/*
+ * 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.iceberg.mr.hive;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.metastore.HiveMetaHook;
+import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.metadata.HiveStorageHandler;
+import org.apache.hadoop.hive.ql.metadata.HiveStoragePredicateHandler;
+import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
+import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
+import org.apache.hadoop.hive.ql.plan.TableDesc;
+import org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider;
+import org.apache.hadoop.hive.serde2.AbstractSerDe;
+import org.apache.hadoop.hive.serde2.Deserializer;
+import org.apache.hadoop.mapred.InputFormat;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapred.OutputFormat;
+import org.apache.iceberg.mr.mapred.IcebergSerDe;
+
+public class HiveIcebergStorageHandler implements HiveStoragePredicateHandler, HiveStorageHandler {
+
+ private Configuration conf;
+
+ @Override
+ public Class<? extends InputFormat> getInputFormatClass() {
+ return HiveIcebergInputFormat.class;
+ }
+
+ @Override
+ public Class<? extends OutputFormat> getOutputFormatClass() {
+ return HiveIgnoreKeyTextOutputFormat.class;
Review comment:
In table metadata, we use `FileOutputFormat` because it can't be instantiated, so any write attempted through a Hive table library would fail, instead of writing data that doesn't appear in the table. Does that need to be done here?
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] rdsr commented on a change in pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
rdsr commented on a change in pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#discussion_r440244289
##########
File path: mr/src/main/java/org/apache/iceberg/mr/mapred/IcebergStorageHandler.java
##########
@@ -0,0 +1,115 @@
+/*
+ * 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.iceberg.mr.mapred;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.metastore.HiveMetaHook;
+import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.metadata.HiveStorageHandler;
+import org.apache.hadoop.hive.ql.metadata.HiveStoragePredicateHandler;
+import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
+import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
+import org.apache.hadoop.hive.ql.plan.TableDesc;
+import org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider;
+import org.apache.hadoop.hive.serde2.AbstractSerDe;
+import org.apache.hadoop.hive.serde2.Deserializer;
+import org.apache.hadoop.mapred.InputFormat;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapred.OutputFormat;
+
+public class IcebergStorageHandler implements HiveStoragePredicateHandler, HiveStorageHandler {
+
+ private Configuration conf;
+
+ @Override
+ public Class<? extends InputFormat> getInputFormatClass() {
+ return IcebergInputFormat.class;
+ }
+
+ @Override
+ public Class<? extends OutputFormat> getOutputFormatClass() {
+ return HiveIgnoreKeyTextOutputFormat.class;
+ }
+
+ @Override
+ public Class<? extends AbstractSerDe> getSerDeClass() {
+ return IcebergSerDe.class;
+ }
+
+ @Override
+ public HiveMetaHook getMetaHook() {
+ return null;
+ }
+
+ @Override
+ public HiveAuthorizationProvider getAuthorizationProvider() throws HiveException {
+ return null;
+ }
+
+ @Override
+ public void configureInputJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureOutputJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureTableJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureJobConf(TableDesc tableDesc, JobConf jobConf) {
+
Review comment:
I think is this the place we can pass in many of the options which Iceberg supports. E.g reading a specific snapshot, case insensitive match etc..
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] rdblue commented on pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
rdblue commented on pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#issuecomment-663728856
Thanks for the update, @massdosage!
If we have a working read path, then it would be awesome to start working on some docs commits to the site as well, although some of the configuration may change with updates to table resolution, #1155.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] massdosage edited a comment on pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
massdosage edited a comment on pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#issuecomment-663503333
> This looks good to me, just a couple minor questions. I'll merge this to unblock next steps.
>
> Where does this fit in the overall plan for Hive support?
Well, this is actually a good milestone as we now have everything that's needed to be able to _read_ Iceberg tables from Hive merged into master.
Up next we were going to add back in the features like pushdowns, system tables, time travel reads etc. but they're all improvements, what is in Iceberg now should work end to end for the read path. One thing I'd like to change to make this easier to use is for the module to build an uber jar so you only have to add one jar to Hive's classpath instead of 6+ which is the case at the moment. Once that's done we also need to add documentation describing this all.
> Are tests going to be added next? What works right now and what doesn't?
@guilload ended up adding the tests in #1192 - the main test class is [TestHiveIcebergInputFormat](https://github.com/apache/iceberg/blob/master/mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergInputFormat.java). We were planning to flesh that out with more tests as we add in the above features etc.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] pvary commented on a change in pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
pvary commented on a change in pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#discussion_r458751388
##########
File path: mr/src/main/java/org/apache/iceberg/mr/mapred/IcebergStorageHandler.java
##########
@@ -0,0 +1,115 @@
+/*
+ * 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.iceberg.mr.mapred;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.metastore.HiveMetaHook;
+import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.metadata.HiveStorageHandler;
+import org.apache.hadoop.hive.ql.metadata.HiveStoragePredicateHandler;
+import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
+import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
+import org.apache.hadoop.hive.ql.plan.TableDesc;
+import org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider;
+import org.apache.hadoop.hive.serde2.AbstractSerDe;
+import org.apache.hadoop.hive.serde2.Deserializer;
+import org.apache.hadoop.mapred.InputFormat;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapred.OutputFormat;
+
+public class IcebergStorageHandler implements HiveStoragePredicateHandler, HiveStorageHandler {
+
+ private Configuration conf;
+
+ @Override
+ public Class<? extends InputFormat> getInputFormatClass() {
+ return IcebergInputFormat.class;
+ }
+
+ @Override
+ public Class<? extends OutputFormat> getOutputFormatClass() {
+ return HiveIgnoreKeyTextOutputFormat.class;
+ }
+
+ @Override
+ public Class<? extends AbstractSerDe> getSerDeClass() {
+ return IcebergSerDe.class;
+ }
+
+ @Override
+ public HiveMetaHook getMetaHook() {
+ return null;
+ }
+
+ @Override
+ public HiveAuthorizationProvider getAuthorizationProvider() throws HiveException {
+ return null;
+ }
+
+ @Override
+ public void configureInputJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureOutputJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureTableJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureJobConf(TableDesc tableDesc, JobConf jobConf) {
+
+ }
+
+ @Override
+ public Configuration getConf() {
+ return conf;
+ }
+
+ @Override
+ public void setConf(Configuration conf) {
+ this.conf = conf;
+ }
+ @Override
+ public String toString() {
+ return this.getClass().getName();
+ }
+
+ /**
+ * @param jobConf Job configuration for InputFormat to access
+ * @param deserializer Deserializer
+ * @param exprNodeDesc Filter expression extracted by Hive
+ * @return Entire filter to take advantage of Hive's pruning as well as Iceberg's pruning.
+ */
+ @Override
+ public DecomposedPredicate decomposePredicate(JobConf jobConf, Deserializer deserializer, ExprNodeDesc exprNodeDesc) {
+ DecomposedPredicate predicate = new DecomposedPredicate();
+ predicate.residualPredicate = (ExprNodeGenericFuncDesc) exprNodeDesc;
Review comment:
As a first implementation it is correct.
Maybe stating the obvious, but if we know that the Iceberg predicate will cover the expression fully, then we can return empty residualPredicate so we will not have an unnecessary filtering operation in Hive. Or if the expression filtering is covered by Iceberg partially then Hive should filter only for the residual filter.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] rdblue commented on a change in pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#discussion_r458951872
##########
File path: mr/src/main/java/org/apache/iceberg/mr/mapred/IcebergStorageHandler.java
##########
@@ -0,0 +1,115 @@
+/*
+ * 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.iceberg.mr.mapred;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.metastore.HiveMetaHook;
+import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.metadata.HiveStorageHandler;
+import org.apache.hadoop.hive.ql.metadata.HiveStoragePredicateHandler;
+import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
+import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
+import org.apache.hadoop.hive.ql.plan.TableDesc;
+import org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider;
+import org.apache.hadoop.hive.serde2.AbstractSerDe;
+import org.apache.hadoop.hive.serde2.Deserializer;
+import org.apache.hadoop.mapred.InputFormat;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapred.OutputFormat;
+
+public class IcebergStorageHandler implements HiveStoragePredicateHandler, HiveStorageHandler {
+
+ private Configuration conf;
+
+ @Override
+ public Class<? extends InputFormat> getInputFormatClass() {
+ return IcebergInputFormat.class;
+ }
+
+ @Override
+ public Class<? extends OutputFormat> getOutputFormatClass() {
+ return HiveIgnoreKeyTextOutputFormat.class;
+ }
+
+ @Override
+ public Class<? extends AbstractSerDe> getSerDeClass() {
+ return IcebergSerDe.class;
+ }
+
+ @Override
+ public HiveMetaHook getMetaHook() {
+ return null;
+ }
+
+ @Override
+ public HiveAuthorizationProvider getAuthorizationProvider() throws HiveException {
+ return null;
+ }
+
+ @Override
+ public void configureInputJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureOutputJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureTableJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureJobConf(TableDesc tableDesc, JobConf jobConf) {
+
+ }
+
+ @Override
+ public Configuration getConf() {
+ return conf;
+ }
+
+ @Override
+ public void setConf(Configuration conf) {
+ this.conf = conf;
+ }
+ @Override
+ public String toString() {
+ return this.getClass().getName();
+ }
+
+ /**
+ * @param jobConf Job configuration for InputFormat to access
+ * @param deserializer Deserializer
+ * @param exprNodeDesc Filter expression extracted by Hive
+ * @return Entire filter to take advantage of Hive's pruning as well as Iceberg's pruning.
+ */
+ @Override
+ public DecomposedPredicate decomposePredicate(JobConf jobConf, Deserializer deserializer, ExprNodeDesc exprNodeDesc) {
+ DecomposedPredicate predicate = new DecomposedPredicate();
+ predicate.residualPredicate = (ExprNodeGenericFuncDesc) exprNodeDesc;
Review comment:
The challenge here is that Iceberg produces per-split residuals, so we would need to return them for each split, or find the common filter that needs to be applied to all splits.
There's also a question of whether Hive or Iceberg is better at doing the filtering. For vectorized reads, Iceberg may be better. But for row-based reads, engines are typically better. That's why we delegate final filtering to Spark, which will benefit from that engine's codegen.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] massdosage commented on a change in pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
massdosage commented on a change in pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#discussion_r460164557
##########
File path: mr/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java
##########
@@ -0,0 +1,117 @@
+/*
+ * 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.iceberg.mr.hive;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.metastore.HiveMetaHook;
+import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.metadata.HiveStorageHandler;
+import org.apache.hadoop.hive.ql.metadata.HiveStoragePredicateHandler;
+import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
+import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
+import org.apache.hadoop.hive.ql.plan.TableDesc;
+import org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider;
+import org.apache.hadoop.hive.serde2.AbstractSerDe;
+import org.apache.hadoop.hive.serde2.Deserializer;
+import org.apache.hadoop.mapred.InputFormat;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapred.OutputFormat;
+import org.apache.iceberg.mr.mapred.IcebergSerDe;
+
+public class HiveIcebergStorageHandler implements HiveStoragePredicateHandler, HiveStorageHandler {
+
+ private Configuration conf;
+
+ @Override
+ public Class<? extends InputFormat> getInputFormatClass() {
+ return HiveIcebergInputFormat.class;
+ }
+
+ @Override
+ public Class<? extends OutputFormat> getOutputFormatClass() {
+ return HiveIgnoreKeyTextOutputFormat.class;
Review comment:
Another option would be to create a HiveIcebergOutputFormat class that throws UnsupportedOperationExceptions, this is what they do in [Delta's Hive connector](https://github.com/delta-io/connectors/blob/master/hive/src/main/scala/io/delta/hive/DeltaOutputFormat.scala).
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] rdblue commented on a change in pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#discussion_r459805723
##########
File path: mr/src/main/java/org/apache/iceberg/mr/mapred/IcebergStorageHandler.java
##########
@@ -0,0 +1,115 @@
+/*
+ * 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.iceberg.mr.mapred;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.metastore.HiveMetaHook;
+import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.metadata.HiveStorageHandler;
+import org.apache.hadoop.hive.ql.metadata.HiveStoragePredicateHandler;
+import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
+import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
+import org.apache.hadoop.hive.ql.plan.TableDesc;
+import org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider;
+import org.apache.hadoop.hive.serde2.AbstractSerDe;
+import org.apache.hadoop.hive.serde2.Deserializer;
+import org.apache.hadoop.mapred.InputFormat;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapred.OutputFormat;
+
+public class IcebergStorageHandler implements HiveStoragePredicateHandler, HiveStorageHandler {
+
+ private Configuration conf;
+
+ @Override
+ public Class<? extends InputFormat> getInputFormatClass() {
+ return IcebergInputFormat.class;
+ }
+
+ @Override
+ public Class<? extends OutputFormat> getOutputFormatClass() {
+ return HiveIgnoreKeyTextOutputFormat.class;
+ }
+
+ @Override
+ public Class<? extends AbstractSerDe> getSerDeClass() {
+ return IcebergSerDe.class;
+ }
+
+ @Override
+ public HiveMetaHook getMetaHook() {
+ return null;
+ }
+
+ @Override
+ public HiveAuthorizationProvider getAuthorizationProvider() throws HiveException {
+ return null;
+ }
+
+ @Override
+ public void configureInputJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureOutputJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureTableJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureJobConf(TableDesc tableDesc, JobConf jobConf) {
+
+ }
+
+ @Override
+ public Configuration getConf() {
+ return conf;
+ }
+
+ @Override
+ public void setConf(Configuration conf) {
+ this.conf = conf;
+ }
+ @Override
+ public String toString() {
+ return this.getClass().getName();
+ }
+
+ /**
+ * @param jobConf Job configuration for InputFormat to access
+ * @param deserializer Deserializer
+ * @param exprNodeDesc Filter expression extracted by Hive
+ * @return Entire filter to take advantage of Hive's pruning as well as Iceberg's pruning.
+ */
+ @Override
+ public DecomposedPredicate decomposePredicate(JobConf jobConf, Deserializer deserializer, ExprNodeDesc exprNodeDesc) {
+ DecomposedPredicate predicate = new DecomposedPredicate();
+ predicate.residualPredicate = (ExprNodeGenericFuncDesc) exprNodeDesc;
Review comment:
@pvary, thanks for taking a look at these, it's great to have more people with knowledge of Hive participating!
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] pvary commented on a change in pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
pvary commented on a change in pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#discussion_r459277697
##########
File path: mr/src/main/java/org/apache/iceberg/mr/mapred/IcebergStorageHandler.java
##########
@@ -0,0 +1,115 @@
+/*
+ * 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.iceberg.mr.mapred;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.metastore.HiveMetaHook;
+import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.metadata.HiveStorageHandler;
+import org.apache.hadoop.hive.ql.metadata.HiveStoragePredicateHandler;
+import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
+import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
+import org.apache.hadoop.hive.ql.plan.TableDesc;
+import org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider;
+import org.apache.hadoop.hive.serde2.AbstractSerDe;
+import org.apache.hadoop.hive.serde2.Deserializer;
+import org.apache.hadoop.mapred.InputFormat;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapred.OutputFormat;
+
+public class IcebergStorageHandler implements HiveStoragePredicateHandler, HiveStorageHandler {
+
+ private Configuration conf;
+
+ @Override
+ public Class<? extends InputFormat> getInputFormatClass() {
+ return IcebergInputFormat.class;
+ }
+
+ @Override
+ public Class<? extends OutputFormat> getOutputFormatClass() {
+ return HiveIgnoreKeyTextOutputFormat.class;
+ }
+
+ @Override
+ public Class<? extends AbstractSerDe> getSerDeClass() {
+ return IcebergSerDe.class;
+ }
+
+ @Override
+ public HiveMetaHook getMetaHook() {
+ return null;
+ }
+
+ @Override
+ public HiveAuthorizationProvider getAuthorizationProvider() throws HiveException {
+ return null;
+ }
+
+ @Override
+ public void configureInputJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureOutputJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureTableJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureJobConf(TableDesc tableDesc, JobConf jobConf) {
+
+ }
+
+ @Override
+ public Configuration getConf() {
+ return conf;
+ }
+
+ @Override
+ public void setConf(Configuration conf) {
+ this.conf = conf;
+ }
+ @Override
+ public String toString() {
+ return this.getClass().getName();
+ }
+
+ /**
+ * @param jobConf Job configuration for InputFormat to access
+ * @param deserializer Deserializer
+ * @param exprNodeDesc Filter expression extracted by Hive
+ * @return Entire filter to take advantage of Hive's pruning as well as Iceberg's pruning.
+ */
+ @Override
+ public DecomposedPredicate decomposePredicate(JobConf jobConf, Deserializer deserializer, ExprNodeDesc exprNodeDesc) {
+ DecomposedPredicate predicate = new DecomposedPredicate();
+ predicate.residualPredicate = (ExprNodeGenericFuncDesc) exprNodeDesc;
Review comment:
Does Iceberg push these filters to the specific file readers (ORC/Parquet)? Or this predicate pushdown is only for filtering out specific files and not the content of the files?
In Hive we found it very beneficial to push every filter to the readers. This is especially true for column based formats, like Parquet or ORC, where we do not have to deserialize the whole data if filtering already removes the unnecessary rows.
Thanks,
Peter
PS: Maybe this is not the best place to start this conversation. If you feel so, feel free to redirect it to the correct channel. Just started to familiarize myself with the workings of the Iceberg community.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] massdosage commented on pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
massdosage commented on pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#issuecomment-663503333
> This looks good to me, just a couple minor questions. I'll merge this to unblock next steps.
>
> Where does this fit in the overall plan for Hive support?
Well, this is actually a good milestone as we now have everything that's needed to be able to _read_ Iceberg tables from Hive merged into master.
Up next we were going to add back in the features like pushdowns, system tables, time travel reads etc. but they're all improvements, what is in Iceberg now should work end to end for the read path. One thing I'd like to change to make this easier to use is for the module to build an uber jar so you only have to add one jar to Hive's classpath instead of 6+ which is the case at the moment. Once that's done we also need to add documentation describing this all.
> Are tests going to be added next? What works right now and what doesn't?
@guilload ended up adding the tests in #1104, the main test class is [TestHiveIcebergInputFormat](https://github.com/apache/iceberg/blob/master/mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergInputFormat.java). We were planning to flesh that out with more tests as we add in the above features etc.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] pvary commented on a change in pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
pvary commented on a change in pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#discussion_r460292508
##########
File path: mr/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java
##########
@@ -0,0 +1,117 @@
+/*
+ * 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.iceberg.mr.hive;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.metastore.HiveMetaHook;
+import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.metadata.HiveStorageHandler;
+import org.apache.hadoop.hive.ql.metadata.HiveStoragePredicateHandler;
+import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
+import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
+import org.apache.hadoop.hive.ql.plan.TableDesc;
+import org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider;
+import org.apache.hadoop.hive.serde2.AbstractSerDe;
+import org.apache.hadoop.hive.serde2.Deserializer;
+import org.apache.hadoop.mapred.InputFormat;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapred.OutputFormat;
+import org.apache.iceberg.mr.mapred.IcebergSerDe;
+
+public class HiveIcebergStorageHandler implements HiveStoragePredicateHandler, HiveStorageHandler {
+
+ private Configuration conf;
+
+ @Override
+ public Class<? extends InputFormat> getInputFormatClass() {
+ return HiveIcebergInputFormat.class;
+ }
+
+ @Override
+ public Class<? extends OutputFormat> getOutputFormatClass() {
+ return HiveIgnoreKeyTextOutputFormat.class;
Review comment:
That seems like a good option. If we get to the phase when we have a working writer implementation, then if the correct writer is already specified then we do not have to recreate all of the tables. We just change the jars and everything should work like charm :)
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] rdblue commented on pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
rdblue commented on pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#issuecomment-663302696
This looks good to me, just a couple minor questions. I'll merge this to unblock next steps.
Where does this fit in the overall plan for Hive support? Are tests going to be added next? What works right now and what doesn't?
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] pvary commented on pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
pvary commented on pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#issuecomment-663512750
> Up next we were going to add back in the features like pushdowns, system tables, time travel reads etc. but they're all improvements, what is in Iceberg now should work end to end for the read path.
Maybe something like "STORED AS ICEBERG" should help to save the users some time if they are creating the Hive tables manually above existing Iceberg tables. See the same for JSON: https://issues.apache.org/jira/browse/HIVE-19899 - this would need a Hive change after the Iceberg release, but having IcebergStorageFormatDescriptor.java might be a part of the Iceberg project.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] massdosage commented on a change in pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
massdosage commented on a change in pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#discussion_r460005342
##########
File path: mr/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java
##########
@@ -0,0 +1,117 @@
+/*
+ * 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.iceberg.mr.hive;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.metastore.HiveMetaHook;
+import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.metadata.HiveStorageHandler;
+import org.apache.hadoop.hive.ql.metadata.HiveStoragePredicateHandler;
+import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
+import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
+import org.apache.hadoop.hive.ql.plan.TableDesc;
+import org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider;
+import org.apache.hadoop.hive.serde2.AbstractSerDe;
+import org.apache.hadoop.hive.serde2.Deserializer;
+import org.apache.hadoop.mapred.InputFormat;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapred.OutputFormat;
+import org.apache.iceberg.mr.mapred.IcebergSerDe;
+
+public class HiveIcebergStorageHandler implements HiveStoragePredicateHandler, HiveStorageHandler {
+
+ private Configuration conf;
+
+ @Override
+ public Class<? extends InputFormat> getInputFormatClass() {
+ return HiveIcebergInputFormat.class;
+ }
+
+ @Override
+ public Class<? extends OutputFormat> getOutputFormatClass() {
+ return HiveIgnoreKeyTextOutputFormat.class;
+ }
+
+ @Override
+ public Class<? extends AbstractSerDe> getSerDeClass() {
+ return IcebergSerDe.class;
+ }
+
+ @Override
+ public HiveMetaHook getMetaHook() {
+ return null;
+ }
+
+ @Override
+ public HiveAuthorizationProvider getAuthorizationProvider() throws HiveException {
+ return null;
+ }
+
+ @Override
+ public void configureInputJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureOutputJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureTableJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureJobConf(TableDesc tableDesc, JobConf jobConf) {
+
+ }
+
+ @Override
+ public Configuration getConf() {
+ return conf;
+ }
+
+ @Override
+ public void setConf(Configuration conf) {
+ this.conf = conf;
+ }
+
+ @Override
+ public String toString() {
+ return this.getClass().getName();
Review comment:
I had a look at a few and most of them don't override this method. Hive's own JDBC storage handler returns the full class name as a string via a [Constant]( - https://github.com/apache/hive/blob/f37c5de6c32b9395d1b34fa3c02ed06d1bfbf6eb/common/src/java/org/apache/hadoop/hive/conf/Constants.java#L62). So it could be OK like this, or we just remove the method.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] massdosage commented on pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
massdosage commented on pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#issuecomment-643306734
> @massdosage @cmathiesen . In what order should we review the work here? #933 , #1103 and then this PR ?
Hello @rdsr! So, we discussed this with @rdblue and he asked us to try split the code coming out of Hiveberg into separate, discrete PRs where possible, even if some of the PRs didn't add anything that was directly useable. So that's what we've tried to do but only once all 3 are committed does this become really useful for end users.
I would actually suggest doing the reviews in the reverse order and start with this one which is the simplest. Once we have this and #1103 merged in we can add a whole lot more HiveRunner tests to #933 which test the InputFormat, the SerDe and the StorageHandler all working together which would be really nice.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] rdblue commented on a change in pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#discussion_r459805062
##########
File path: mr/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java
##########
@@ -0,0 +1,117 @@
+/*
+ * 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.iceberg.mr.hive;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.metastore.HiveMetaHook;
+import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.metadata.HiveStorageHandler;
+import org.apache.hadoop.hive.ql.metadata.HiveStoragePredicateHandler;
+import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
+import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
+import org.apache.hadoop.hive.ql.plan.TableDesc;
+import org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider;
+import org.apache.hadoop.hive.serde2.AbstractSerDe;
+import org.apache.hadoop.hive.serde2.Deserializer;
+import org.apache.hadoop.mapred.InputFormat;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapred.OutputFormat;
+import org.apache.iceberg.mr.mapred.IcebergSerDe;
+
+public class HiveIcebergStorageHandler implements HiveStoragePredicateHandler, HiveStorageHandler {
+
+ private Configuration conf;
+
+ @Override
+ public Class<? extends InputFormat> getInputFormatClass() {
+ return HiveIcebergInputFormat.class;
+ }
+
+ @Override
+ public Class<? extends OutputFormat> getOutputFormatClass() {
+ return HiveIgnoreKeyTextOutputFormat.class;
+ }
+
+ @Override
+ public Class<? extends AbstractSerDe> getSerDeClass() {
+ return IcebergSerDe.class;
+ }
+
+ @Override
+ public HiveMetaHook getMetaHook() {
+ return null;
+ }
+
+ @Override
+ public HiveAuthorizationProvider getAuthorizationProvider() throws HiveException {
+ return null;
+ }
+
+ @Override
+ public void configureInputJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureOutputJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureTableJobProperties(TableDesc tableDesc, Map<String, String> map) {
+
+ }
+
+ @Override
+ public void configureJobConf(TableDesc tableDesc, JobConf jobConf) {
+
+ }
+
+ @Override
+ public Configuration getConf() {
+ return conf;
+ }
+
+ @Override
+ public void setConf(Configuration conf) {
+ this.conf = conf;
+ }
+
+ @Override
+ public String toString() {
+ return this.getClass().getName();
Review comment:
What do other storage handlers do? Could this be a short name, like "iceberg"?
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] massdosage commented on pull request #1107: Add IcebergStorageHandler
Posted by GitBox <gi...@apache.org>.
massdosage commented on pull request #1107:
URL: https://github.com/apache/iceberg/pull/1107#issuecomment-663019353
This is now ready to review @rdsr @rdblue @guilload. Thanks all!
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org