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 2022/06/28 09:56:27 UTC

[GitHub] [iceberg] saimigo opened a new issue, #5145: org.apache.flink.connectors.hive.FlinkHiveException: Unable to instantiate the hadoop input format

saimigo opened a new issue, #5145:
URL: https://github.com/apache/iceberg/issues/5145

   When I read Iceberg tables using Flink HiveCatalog, based on S3A,  I got this error:
   
   ```
   Exception in thread "main" org.apache.flink.connectors.hive.FlinkHiveException: Unable to instantiate the hadoop input format
       at org.apache.flink.connectors.hive.HiveSourceFileEnumerator.createMRSplits(HiveSourceFileEnumerator.java:100)
       at org.apache.flink.connectors.hive.HiveSourceFileEnumerator.createInputSplits(HiveSourceFileEnumerator.java:71)
       at org.apache.flink.connectors.hive.HiveTableSource.lambda$getDataStream$1(HiveTableSource.java:149)
       at org.apache.flink.connectors.hive.HiveParallelismInference.logRunningTime(HiveParallelismInference.java:107)
       at org.apache.flink.connectors.hive.HiveParallelismInference.infer(HiveParallelismInference.java:95)
       at org.apache.flink.connectors.hive.HiveTableSource.getDataStream(HiveTableSource.java:144)
       at org.apache.flink.connectors.hive.HiveTableSource$1.produceDataStream(HiveTableSource.java:114)
       at org.apache.flink.table.planner.plan.nodes.exec.common.CommonExecTableSourceScan.translateToPlanInternal(CommonExecTableSourceScan.java:106)
       at org.apache.flink.table.planner.plan.nodes.exec.batch.BatchExecTableSourceScan.translateToPlanInternal(BatchExecTableSourceScan.java:49)
       at org.apache.flink.table.planner.plan.nodes.exec.ExecNodeBase.translateToPlan(ExecNodeBase.java:134)
       at org.apache.flink.table.planner.plan.nodes.exec.ExecEdge.translateToPlan(ExecEdge.java:250)
       at org.apache.flink.table.planner.plan.nodes.exec.batch.BatchExecSink.translateToPlanInternal(BatchExecSink.java:58)
       at org.apache.flink.table.planner.plan.nodes.exec.ExecNodeBase.translateToPlan(ExecNodeBase.java:134)
       at org.apache.flink.table.planner.delegation.BatchPlanner.$anonfun$translateToPlan$1(BatchPlanner.scala:82)
       at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:233)
       at scala.collection.Iterator.foreach(Iterator.scala:937)
       at scala.collection.Iterator.foreach$(Iterator.scala:937)
       at scala.collection.AbstractIterator.foreach(Iterator.scala:1425)
       at scala.collection.IterableLike.foreach(IterableLike.scala:70)
       at scala.collection.IterableLike.foreach$(IterableLike.scala:69)
       at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
       at scala.collection.TraversableLike.map(TraversableLike.scala:233)
       at scala.collection.TraversableLike.map$(TraversableLike.scala:226)
       at scala.collection.AbstractTraversable.map(Traversable.scala:104)
       at org.apache.flink.table.planner.delegation.BatchPlanner.translateToPlan(BatchPlanner.scala:81)
       at org.apache.flink.table.planner.delegation.PlannerBase.translate(PlannerBase.scala:185)
       at org.apache.flink.table.api.internal.TableEnvironmentImpl.translate(TableEnvironmentImpl.java:1665)
       at org.apache.flink.table.api.internal.TableEnvironmentImpl.executeQueryOperation(TableEnvironmentImpl.java:805)
       at org.apache.flink.table.api.internal.TableEnvironmentImpl.executeInternal(TableEnvironmentImpl.java:1274)
       at org.apache.flink.table.api.internal.TableImpl.execute(TableImpl.java:601)
       at loshu.flink.hive.FlinkSQLHiveWriter.main(FlinkSQLHiveWriter.java:69)
   Caused by: java.lang.InstantiationException
       at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
       at java.lang.Class.newInstance(Class.java:442)
       at org.apache.flink.connectors.hive.HiveSourceFileEnumerator.createMRSplits(HiveSourceFileEnumerator.java:98)
       ... 30 more
   16:33:36,767 INFO  org.apache.hadoop.metrics2.impl.MetricsSystemImpl            [] - Stopping s3a-file-system metrics system...
   16:33:36,767 INFO  org.apache.hadoop.metrics2.impl.MetricsSystemImpl            [] - s3a-file-system metrics system stopped.
   16:33:36,768 INFO  org.apache.hadoop.metrics2.impl.MetricsSystemImpl            [] - s3a-file-system metrics system shutdown complete.Process finished with exit code 1
   
   ```
   
   My code is:
   ```
   public class FlinkSQLHiveWriter {
       private static org.apache.log4j.Logger log = Logger.getLogger(FlinkSQLHiveWriter.class);
       public static void main(String[] args) throws Exception {
           System.setProperty("HADOOP_USER_NAME", "root");
           System.setProperty("hadoop.home.dir", "/opt/hadoop-3.2.1/");
           EnvironmentSettings settings = EnvironmentSettings.newInstance()
                   .inBatchMode()
                   .build();
           TableEnvironment tableEnv = TableEnvironment.create(settings);
   
           String catalogName = "s3IcebergCatalog";
           String defaultDatabase = "s3a_flink";
           String hiveConfDir = "flink-cloud/src/main/resources"; 
           HiveCatalog hive = new HiveCatalog(catalogName, defaultDatabase, hiveConfDir);
   
           tableEnv.registerCatalog(catalogName, hive);
           tableEnv.useCatalog(catalogName);
           tableEnv.useDatabase(defaultDatabase);
   
           System.out.println(hive.listDatabases());
           System.out.println(hive.listTables(defaultDatabase));
           String tableName = "icebergTBCloudTracking";
           // set sql dialect as default, means using flink sql.
           tableEnv.getConfig().setSqlDialect(SqlDialect.DEFAULT);
   
           String sql = "select vin from " + tableName;
   //        String sql = "DESC " + tableName;
           System.out.println(sql);
           Table table = tableEnv.sqlQuery(sql);
           table.execute();
       }
   } 
   ```
   I can "show tables" or "describe tables", but when using "select * from table" the error occurs.
   
   #ENV
   
   Flink 1.14.2
   Hive 3.1.2
   Scala 2.12
   Iceberg 0.12.1
   Hadoop 3.2.1


-- 
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@iceberg.apache.org.apache.org

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] luoyuxia commented on issue #5145: org.apache.flink.connectors.hive.FlinkHiveException: Unable to instantiate the hadoop input format

Posted by GitBox <gi...@apache.org>.
luoyuxia commented on issue #5145:
URL: https://github.com/apache/iceberg/issues/5145#issuecomment-1296830752

   > how to set hive.input.format in iceberg?
   
   From the code, I'm afraid of there's no way to set `hive.input.format` currently.
   ![image](https://user-images.githubusercontent.com/20389154/198977129-5214f9c5-88e1-4cfc-b2f2-cf0a5af514fd.png)
   
   As a work around, you cat create the orc table using Hive Cli or Flink with Hive dialect.
   


-- 
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@iceberg.apache.org

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


Re: [I] org.apache.flink.connectors.hive.FlinkHiveException: Unable to instantiate the hadoop input format [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #5145:
URL: https://github.com/apache/iceberg/issues/5145#issuecomment-2292492416

   This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.


-- 
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@iceberg.apache.org

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] saimigo commented on issue #5145: org.apache.flink.connectors.hive.FlinkHiveException: Unable to instantiate the hadoop input format

Posted by GitBox <gi...@apache.org>.
saimigo commented on issue #5145:
URL: https://github.com/apache/iceberg/issues/5145#issuecomment-1170787158

   when I create iceberg table use ORC format, the default inputformat set as follow:
   ```
   CREATE EXTERNAL TABLE `icebergtbcloudtrackingTest`(
     `vin` string, 
     `name` string, 
     `uuid` string, 
     `channel` string, 
     `run_scene` string, 
     `timestamp` timestamp, 
     `rcv_timestamp` timestamp, 
     `raw` string)
   ROW FORMAT SERDE 
     'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' 
   STORED AS INPUTFORMAT 
     'org.apache.hadoop.mapred.FileInputFormat' 
   OUTPUTFORMAT 
     'org.apache.hadoop.mapred.FileOutputFormat'
   ```
   
   My code to create a table. how to set hive.input.format = org.apache.hadoop.hive.ql.io.orc.OrcInputFormat  in SDK? Thanks.
   
   ```
   Map<String, String> properties = new HashMap<>();
           properties.put("type", "iceberg");
           properties.put("clients", "5");
           properties.put("property-version", "1");
           properties.put("warehouse", "s3a://warehouse/");
           properties.put("catalog-type", "hive");
           properties.put("uri", "thrift://hiveserver:9083");
   
   
           Configuration conf = new Configuration();
           conf.set("fs.s3a.connection.ssl.enabled", "false");
           conf.set("fs.s3a.endpoint", "http://mys3");
           conf.set("fs.s3a.region", "us-east-1");
           conf.set("fs.s3a.path.style.access", "true");
           conf.set("fs.s3a.impl", "org.apache.hadoop.fs.s3a.S3AFileSystem");
           conf.set("fs.s3a.fast.upload", "true");
           conf.set("execution.checkpointing.checkpoints-after-tasks-finish.enabled", "true");
   
           String HIVE_CATALOG = "s3IcebergCatalog";
           CatalogLoader catalogLoader = CatalogLoader.hive(HIVE_CATALOG, conf, properties);
           HiveCatalog catalog = (HiveCatalog) catalogLoader.loadCatalog();
   
           Namespace namespace = Namespace.of("s3a_flink");
           if (!catalog.namespaceExists(namespace))
               catalog.createNamespace(namespace);
   
           TableIdentifier name =
                   TableIdentifier.of(namespace, "icebergTBCloudTracking");
   
           Schema schema = new Schema(0,
                   Types.NestedField.required(1, "vin", Types.StringType.get()),
                   Types.NestedField.required(2, "name", Types.StringType.get()),
                   Types.NestedField.optional(3, "uuid", Types.StringType.get()),
                   Types.NestedField.required(4, "channel", Types.StringType.get()),
                   Types.NestedField.required(5, "run_scene", Types.StringType.get()),
                   Types.NestedField.required(6, "timestamp", Types.TimestampType.withoutZone()),
                   Types.NestedField.required(7, "rcv_timestamp", Types.TimestampType.withoutZone()),
                   Types.NestedField.required(8, "raw", Types.StringType.get())
                   );
   
            PartitionSpec spec = PartitionSpec.unpartitioned();
   
           Map<String, String> props =
                   ImmutableMap.of(TableProperties.DEFAULT_FILE_FORMAT, FileFormat.ORC.name());
   
           Table table = null;
    
           if (!catalog.tableExists(name))
               table = catalog.createTable(name, schema, spec, props);
           else
               table = catalog.loadTable(name);
   ```
   


-- 
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@iceberg.apache.org

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] saimigo commented on issue #5145: org.apache.flink.connectors.hive.FlinkHiveException: Unable to instantiate the hadoop input format

Posted by GitBox <gi...@apache.org>.
saimigo commented on issue #5145:
URL: https://github.com/apache/iceberg/issues/5145#issuecomment-1170773444

   how to set hive.input.format in 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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

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


Re: [I] org.apache.flink.connectors.hive.FlinkHiveException: Unable to instantiate the hadoop input format [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #5145:
URL: https://github.com/apache/iceberg/issues/5145#issuecomment-2342374036

   This issue has been closed because it has not received any activity in the last 14 days since being marked as 'stale'


-- 
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@iceberg.apache.org

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


Re: [I] org.apache.flink.connectors.hive.FlinkHiveException: Unable to instantiate the hadoop input format [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #5145: org.apache.flink.connectors.hive.FlinkHiveException: Unable to instantiate the hadoop input format
URL: https://github.com/apache/iceberg/issues/5145


-- 
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@iceberg.apache.org

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