marton-bod commented on a change in pull request #2316:
URL: https://github.com/apache/hive/pull/2316#discussion_r639509256
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/FileSinkOperator.java
##########
@@ -736,6 +740,21 @@ protected void initializeOp(Configuration hconf) throws
HiveException {
}
}
+ private boolean skipPartitionCheck() {
+ return Optional.ofNullable(conf).map(FileSinkDesc::getTableInfo)
+ .map(TableDesc::getProperties)
+ .map(props ->
props.getProperty(hive_metastoreConstants.META_TABLE_STORAGE))
+ .map(handler -> {
+ try {
+ return HiveUtils.getStorageHandler(hconf, handler);
+ } catch (HiveException e) {
+ return null;
Review comment:
If we return null in any of the map functions in Optional, then it will
fall back to the `orElse` part (i.e. subsequent map functions won't fail)
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/FileSinkOperator.java
##########
@@ -736,6 +740,21 @@ protected void initializeOp(Configuration hconf) throws
HiveException {
}
}
+ private boolean skipPartitionCheck() {
+ return Optional.ofNullable(conf).map(FileSinkDesc::getTableInfo)
+ .map(TableDesc::getProperties)
+ .map(props ->
props.getProperty(hive_metastoreConstants.META_TABLE_STORAGE))
+ .map(handler -> {
+ try {
+ return HiveUtils.getStorageHandler(hconf, handler);
+ } catch (HiveException e) {
+ return null;
+ }
+ })
+ .map(HiveStorageHandler::alwaysUnpartitioned)
Review comment:
No, it shouldn't. If we return null in any of the map functions in
Optional, then it will fall back to the `orElse` part (i.e. subsequent map
functions won't fail)
--
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]