difin commented on code in PR #6834:
URL: https://github.com/apache/hive/pull/6834#discussion_r4320053674
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -1881,17 +1889,28 @@ private String
collectColumnAndReplaceDummyValues(ExprNodeDesc node, String foun
* </ul>
* @param tableProps table properties, must be not null
*/
- private void fallbackToNonVectorizedModeBasedOnProperties(Properties
tableProps) {
+ private boolean vectorizationUnsupported(Properties tableProps) {
Schema tableSchema =
SchemaParser.fromJson(tableProps.getProperty(InputFormatConfig.TABLE_SCHEMA));
- if (FileFormat.AVRO ==
IcebergTableUtil.defaultFileFormat(tableProps::getProperty) ||
+ return FileFormat.AVRO ==
IcebergTableUtil.defaultFileFormat(tableProps::getProperty) ||
isValidMetadataTable(tableProps.getProperty(IcebergAcidUtil.META_TABLE_PROPERTY))
||
hasOrcTimeInSchema(tableProps, tableSchema) ||
- !hasParquetNestedTypeWithinListOrMap(tableProps, tableSchema)) {
- // disable vectorization
- SessionStateUtil.getQueryState(conf).ifPresent(qs ->
- qs.getConf().setBoolVar(ConfVars.HIVE_VECTORIZATION_ENABLED, false));
- }
+ !hasParquetNestedTypeWithinListOrMap(tableProps, tableSchema);
+ }
+
+ /**
+ * Whether the scanned snapshot has equality deletes, which the vectorized
reader cannot apply
+ * (HiveVectorizedReader): the current one, or the head of the branch or tag
scanned.
+ */
+ private boolean hasEqualityDeletes(Properties tableProps) {
+ Snapshot snapshot = IcebergTableUtil.getTableSnapshot(
+ IcebergTableUtil.getTable(conf, tableProps),
tableProps.getProperty(Catalogs.SNAPSHOT_REF));
+ return snapshot != null && PropertyUtil.propertyAsLong(snapshot.summary(),
TOTAL_EQ_DELETES_PROP, 0) > 0;
Review Comment:
Should there be a special handling in case of a pinned snapshot (`FOR
SYSTEM_VERSION AS OF ...` and `FOR SYSTEM_TIME AS OF ...` ) as per the copilot
comment above?
--
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]