>From Peeyush Gupta <[email protected]>:
Peeyush Gupta has uploaded this change for review. (
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17746 )
Change subject: [NO ISSUE][COMP] Show proper error message with invalid type
......................................................................
[NO ISSUE][COMP] Show proper error message with invalid type
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
While creating dataset without type spec, if a invalid type is used,
a null pointer exception was shown. With this patch we now show a proper
error message.
Change-Id: I7edfe4f52c20da7f667c9560edea50fd7112932f
---
M
asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java
1 file changed, 22 insertions(+), 0 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb
refs/changes/46/17746/1
diff --git
a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java
b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java
index 967f99f..1728b7b 100644
---
a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java
+++
b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java
@@ -170,6 +170,10 @@
String typeName =
((TypeReferenceExpression)
partitioningExprTypes.get(i)).getIdent().second.getValue();
fieldType = BuiltinTypeMap.getBuiltinType(typeName);
+ if (fieldType == null) {
+ throw new
CompilationException(ErrorCode.COMPILATION_ILLEGAL_KEY_TYPE, sourceLoc,
typeName,
+ keyKindDisplayName);
+ }
computedPartitioningExprTypes.add(fieldType);
} else {
fieldType = computedPartitioningExprTypes.get(i);
--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17746
To unsubscribe, or for help writing mail filters, visit
https://asterix-gerrit.ics.uci.edu/settings
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I7edfe4f52c20da7f667c9560edea50fd7112932f
Gerrit-Change-Number: 17746
Gerrit-PatchSet: 1
Gerrit-Owner: Peeyush Gupta <[email protected]>
Gerrit-MessageType: newchange