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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to