You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by kg...@apache.org on 2019/05/27 14:00:42 UTC
[hive] 02/02: HIVE-21791: Fix Surrogate Key issue for insert with
select with limit operations (Miklos Gergely via Zoltan Haindrich)
This is an automated email from the ASF dual-hosted git repository.
kgyrtkirk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git
commit 5bc0364565171d0d79937ce4f53a136c68693466
Author: Miklos Gergely <mg...@hortonworks.com>
AuthorDate: Mon May 27 15:49:19 2019 +0200
HIVE-21791: Fix Surrogate Key issue for insert with select with limit operations (Miklos Gergely via Zoltan Haindrich)
Signed-off-by: Zoltan Haindrich <ki...@rxd.hu>
---
.../apache/hadoop/hive/ql/parse/SemanticAnalyzer.java | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
index a3da075..aadbf38 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
@@ -8013,16 +8013,18 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
}
private void setWriteIdForSurrogateKeys(LoadTableDesc ltd, Operator input) throws SemanticException {
- Map<String, ExprNodeDesc> columnExprMap = input.getConf().getColumnExprMap();
- if (ltd == null || columnExprMap == null) {
+ if (ltd == null) {
return;
}
- for (ExprNodeDesc desc : columnExprMap.values()) {
- if (desc instanceof ExprNodeGenericFuncDesc) {
- GenericUDF genericUDF = ((ExprNodeGenericFuncDesc)desc).getGenericUDF();
- if (genericUDF instanceof GenericUDFSurrogateKey) {
- ((GenericUDFSurrogateKey)genericUDF).setWriteId(ltd.getWriteId());
+ Map<String, ExprNodeDesc> columnExprMap = input.getConf().getColumnExprMap();
+ if (columnExprMap != null) {
+ for (ExprNodeDesc desc : columnExprMap.values()) {
+ if (desc instanceof ExprNodeGenericFuncDesc) {
+ GenericUDF genericUDF = ((ExprNodeGenericFuncDesc)desc).getGenericUDF();
+ if (genericUDF instanceof GenericUDFSurrogateKey) {
+ ((GenericUDFSurrogateKey)genericUDF).setWriteId(ltd.getWriteId());
+ }
}
}
}