deniskuzZ commented on code in PR #4346:
URL: https://github.com/apache/hive/pull/4346#discussion_r1232476652
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveTableUtil.java:
##########
@@ -225,4 +233,30 @@ public static boolean isCtas(Properties properties) {
return
Boolean.parseBoolean(properties.getProperty(hive_metastoreConstants.TABLE_IS_CTAS));
}
+ static Properties getSerializationProps() {
+ Properties props = new Properties();
+ props.put(serdeConstants.SERIALIZATION_FORMAT, "" + Utilities.tabCode);
+ props.put(serdeConstants.SERIALIZATION_NULL_FORMAT, "NULL");
+ return props;
+ }
+
+ static String getParseData(String parseData, String specId, ObjectMapper
mapper, Integer currentSpecId)
+ throws JsonProcessingException {
+ Map<String, String> map = mapper.readValue(parseData, Map.class);
+ String partString =
+ map.entrySet().stream().filter(entry -> entry.getValue() !=
null).map(java.lang.Object::toString)
+ .collect(Collectors.joining("/"));
+ String currentSpecMarker = currentSpecId.toString().equals(specId) ? "*" :
"";
+ return String.format("Spec-id=%s%s/%s", specId, currentSpecMarker,
partString);
+ }
+
+ static JobConf getPartJobConf(Configuration confs, Path path,
org.apache.hadoop.hive.ql.metadata.Table tbl) {
+ JobConf job = new JobConf(confs);
+ job.set(ColumnProjectionUtils.READ_COLUMN_NAMES_CONF_STR,
"partition,record_count,file_count,spec_id");
Review Comment:
move to constants PARTITION_SCHEMA
--
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]