You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/11/25 15:32:29 UTC

[GitHub] [calcite] julianhyde commented on a change in pull request #2272: [CALCITE-4409] Improve exception when RelBuilder tries to create a field on a non-struct expression

julianhyde commented on a change in pull request #2272:
URL: https://github.com/apache/calcite/pull/2272#discussion_r530460652



##########
File path: core/src/main/java/org/apache/calcite/rel/type/RelDataTypeImpl.java
##########
@@ -79,6 +79,10 @@ protected RelDataTypeImpl() {
 
   @Override public RelDataTypeField getField(String fieldName, boolean caseSensitive,
       boolean elideRecord) {
+    if (fieldList == null) {
+      throw new IllegalStateException("Requested field " + fieldName
+          + " in a type with null fieldList, type = " + this);

Review comment:
       I’d prefer a simpler error message, such as “Type does not support fields”. Especially if it’s emitted by RelDataType, which is a low level class and not supposed to be user-friendly.




----------------------------------------------------------------
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:
users@infra.apache.org