This is an automated email from the ASF dual-hosted git repository.

mblow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git

commit c2682ac05843d4cbc9b37dac5bf010d276f1d167
Author: Ali Alsuliman <[email protected]>
AuthorDate: Tue Aug 6 13:34:13 2024 -0700

    [NO ISSUE][OTH] Modify error message of META()
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Details:
    
    Ext-ref: MB-52982
    Change-Id: I3a4253092da8723b8e352d284e1aeaecf93c621f
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18627
    Integration-Tests: Jenkins <[email protected]>
    Tested-by: Jenkins <[email protected]>
    Reviewed-by: Ali Alsuliman <[email protected]>
    Reviewed-by: Till Westmann <[email protected]>
---
 .../asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml    | 2 +-
 .../src/test/resources/runtimets/testsuite_sqlpp_profiled.xml       | 2 +-
 .../java/org/apache/asterix/runtime/functions/FunctionManager.java  | 6 ++++--
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml 
b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index 3abfdd66df..b6db158ff2 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -14186,7 +14186,7 @@
     <test-case FilePath="meta">
       <compilation-unit name="meta_after_gby">
         <output-dir compare="Text">meta_after_gby</output-dir>
-        <expected-error>Compilation error: Inappropriate use of function 
'meta'. For example, after GROUP BY (in line 29, at column 21)</expected-error>
+        <expected-error>Compilation error: No source collection found for 
META(): collection not supported or cannot reference collection (in line 29, at 
column 21)</expected-error>
       </compilation-unit>
     </test-case>
     <test-case FilePath="meta">
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp_profiled.xml
 
b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp_profiled.xml
index c22d6d0601..1972596468 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp_profiled.xml
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp_profiled.xml
@@ -13994,7 +13994,7 @@
     <test-case FilePath="meta">
       <compilation-unit name="meta_after_gby">
         <output-dir compare="Text">meta_after_gby</output-dir>
-        <expected-error>Compilation error: Inappropriate use of function 
'meta'. For example, after GROUP BY (in line 29, at column 21)</expected-error>
+        <expected-error>Compilation error: No source collection found for 
META(): collection not supported or cannot reference collection (in line 29, at 
column 21)</expected-error>
       </compilation-unit>
     </test-case>
     <test-case FilePath="meta">
diff --git 
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionManager.java
 
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionManager.java
index 71585584c5..d58eeeb958 100644
--- 
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionManager.java
+++ 
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionManager.java
@@ -65,9 +65,11 @@ public final class FunctionManager implements 
IFunctionManager {
         Pair<FunctionIdentifier, Integer> key = new Pair<>(fid, 
fid.getArity());
         IFunctionDescriptorFactory factory = functions.get(key);
         if (factory == null) {
-            String msg = "Inappropriate use of function '" + fid.getName() + 
"'";
+            String msg;
             if (fid.equals(BuiltinFunctions.META)) {
-                msg = msg + ". For example, after GROUP BY";
+                msg = "No source collection found for META(): collection not 
supported or cannot reference collection";
+            } else {
+                msg = "Could not resolve function '" + fid.getName() + "'";
             }
             throw AsterixException.create(ErrorCode.COMPILATION_ERROR, src, 
msg);
         }

Reply via email to