asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From buyin...@apache.org
Subject [1/2] incubator-asterixdb git commit: ASTERIXDB-1329: fix substring type computer for arguments with ANY type.
Date Fri, 04 Mar 2016 01:43:23 GMT
Repository: incubator-asterixdb
Updated Branches:
  refs/heads/master cc17a1828 -> 640b44807


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/query-ASTERIXDB-1263.23.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/query-ASTERIXDB-1263.23.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/query-ASTERIXDB-1263.23.ast
new file mode 100644
index 0000000..59998f2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/query-ASTERIXDB-1263.23.ast
@@ -0,0 +1,61 @@
+DataverseUse TinySocial
+Query:
+SELECT [
+Variable [ Name=h ]
+hour
+FunctionCall TinySocial.count@1[
+  Variable [ Name=t ]
+]
+count
+(
+  SELECT [
+  Variable [ Name=min ]
+  minute
+  FunctionCall TinySocial.count@1[
+    Variable [ Name=k ]
+  ]
+  sum
+  ]
+  FROM [    Variable [ Name=t ]
+    AS
+    Variable [ Name=k ]
+  ]
+  Groupby
+    Variable [ Name=min ]
+    :=
+    FunctionCall TinySocial.get-minute@1[
+      FieldAccessor [
+        Variable [ Name=k ]
+        Field=send-time
+      ]
+    ]
+    With
+    Variable [ Name=k ]
+    Variable [ Name=t ]
+    Variable [ Name=h ]
+
+  Orderby
+    Variable [ Name=min ]
+    ASC
+
+)
+finer
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [TweetMessages]
+  ]
+  AS
+  Variable [ Name=t ]
+]
+Groupby
+  Variable [ Name=h ]
+  :=
+  FunctionCall TinySocial.get-hour@1[
+    FieldAccessor [
+      Variable [ Name=t ]
+      Field=send-time
+    ]
+  ]
+  With
+  Variable [ Name=t ]
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/query-ASTERIXDB-1329.24.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/query-ASTERIXDB-1329.24.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/query-ASTERIXDB-1329.24.ast
new file mode 100644
index 0000000..ee00dd5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/query-ASTERIXDB-1329.24.ast
@@ -0,0 +1,86 @@
+DataverseUse TinySocial
+Query:
+SELECT [
+FieldAccessor [
+  Variable [ Name=user ]
+  Field=name
+]
+uname
+FieldAccessor [
+  Variable [ Name=user ]
+  Field=alias
+]
+alias
+FunctionCall TinySocial.substring@2[
+  FieldAccessor [
+    Variable [ Name=message ]
+    Field=message
+  ]
+  LiteralExpr [LONG] [30]
+]
+msg
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [FacebookMessages]
+  ]
+  AS
+  Variable [ Name=message ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [FacebookUsers]
+  ]
+  AS
+  Variable [ Name=user ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=message ]
+        Field=author-id
+      ]
+      =
+      FieldAccessor [
+        Variable [ Name=user ]
+        Field=id
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=message ]
+        Field=in-response-to
+      ]
+      >=
+      LiteralExpr [LONG] [1]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=message ]
+        Field=in-response-to
+      ]
+      <
+      LiteralExpr [LONG] [11]
+    ]
+  ]
+Orderby
+  FieldAccessor [
+    Variable [ Name=user ]
+    Field=name
+  ]
+  ASC
+  FieldAccessor [
+    Variable [ Name=user ]
+    Field=alias
+  ]
+  ASC
+  FunctionCall TinySocial.substring@2[
+    FieldAccessor [
+      Variable [ Name=message ]
+      Field=message
+    ]
+    LiteralExpr [LONG] [30]
+  ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.1.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.1.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.1.ast
new file mode 100644
index 0000000..1b56984
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.1.ast
@@ -0,0 +1,21 @@
+DataverseUse TinySocial
+TypeDecl TwitterUserType [
+  open RecordType {
+    screen-name : string
+  }
+]
+TypeDecl TweetMessageType [
+  open RecordType {
+    tweetid : string
+  }
+]
+TypeDecl FacebookUserType [
+  open RecordType {
+    id : int64
+  }
+]
+TypeDecl FacebookMessageType [
+  open RecordType {
+    message-id : int64
+  }
+]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.10.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.10.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.10.ast
new file mode 100644
index 0000000..186b777
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.10.ast
@@ -0,0 +1,73 @@
+DataverseUse TinySocial
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [message]
+    :
+    FieldAccessor [
+      Variable [ Name=t ]
+      Field=message-text
+    ]
+  )
+  (
+    LiteralExpr [STRING] [nearby-messages]
+    :
+    (
+      SELECT ELEMENT [
+      RecordConstructor [
+        (
+          LiteralExpr [STRING] [msgtxt]
+          :
+          FieldAccessor [
+            Variable [ Name=t2 ]
+            Field=message-text
+          ]
+        )
+      ]
+      ]
+      FROM [        FunctionCall Metadata.dataset@1[
+          LiteralExpr [STRING] [TweetMessages]
+        ]
+        AS
+        Variable [ Name=t2 ]
+      ]
+      Where
+        OperatorExpr [
+          FunctionCall TinySocial.spatial-distance@2[
+            FieldAccessor [
+              Variable [ Name=t ]
+              Field=sender-location
+            ]
+            FieldAccessor [
+              Variable [ Name=t2 ]
+              Field=sender-location
+            ]
+          ]
+          <=
+          LiteralExpr [LONG] [1]
+        ]
+      Orderby
+        FieldAccessor [
+          Variable [ Name=t2 ]
+          Field=message-text
+        ]
+        ASC
+
+    )
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [TweetMessages]
+  ]
+  AS
+  Variable [ Name=t ]
+]
+Orderby
+  FieldAccessor [
+    Variable [ Name=t ]
+    Field=message-text
+  ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.11.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.11.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.11.ast
new file mode 100644
index 0000000..ece5063
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.11.ast
@@ -0,0 +1,87 @@
+DataverseUse TinySocial
+Set simfunction=edit-distance
+Set simthreshold=3
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [id]
+    :
+    FieldAccessor [
+      Variable [ Name=fbu ]
+      Field=id
+    ]
+  )
+  (
+    LiteralExpr [STRING] [name]
+    :
+    FieldAccessor [
+      Variable [ Name=fbu ]
+      Field=name
+    ]
+  )
+  (
+    LiteralExpr [STRING] [similar-users]
+    :
+    (
+      SELECT ELEMENT [
+      RecordConstructor [
+        (
+          LiteralExpr [STRING] [twitter-screenname]
+          :
+          FieldAccessor [
+            Variable [ Name=tu ]
+            Field=screen-name
+          ]
+        )
+        (
+          LiteralExpr [STRING] [twitter-name]
+          :
+          FieldAccessor [
+            Variable [ Name=tu ]
+            Field=name
+          ]
+        )
+      ]
+      ]
+      FROM [        FunctionCall Metadata.dataset@1[
+          LiteralExpr [STRING] [TweetMessages]
+        ]
+        AS
+        Variable [ Name=t ]
+      ]
+      LetVariable [ Name=tu ]
+        :=
+        FieldAccessor [
+          Variable [ Name=t ]
+          Field=user
+        ]
+      Where
+        OperatorExpr [
+          FieldAccessor [
+            Variable [ Name=tu ]
+            Field=name
+          ]
+          ~=
+          FieldAccessor [
+            Variable [ Name=fbu ]
+            Field=name
+          ]
+        ]
+    )
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [FacebookUsers]
+  ]
+  AS
+  Variable [ Name=fbu ]
+]
+Orderby
+  FieldAccessor [
+    Variable [ Name=fbu ]
+    Field=id
+  ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.12.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.12.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.12.ast
new file mode 100644
index 0000000..2b942b0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.12.ast
@@ -0,0 +1,36 @@
+DataverseUse TinySocial
+Query:
+SELECT ELEMENT [
+Variable [ Name=fbu ]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [FacebookUsers]
+  ]
+  AS
+  Variable [ Name=fbu ]
+]
+Where
+  QuantifiedExpression SOME [
+    [Variable [ Name=e ]
+    In
+      FieldAccessor [
+        Variable [ Name=fbu ]
+        Field=employment
+      ]
+    ]
+    Satifies [
+      FunctionCall TinySocial.is-null@1[
+        FieldAccessor [
+          Variable [ Name=e ]
+          Field=end-date
+        ]
+      ]
+    ]
+  ]
+Orderby
+  FieldAccessor [
+    Variable [ Name=fbu ]
+    Field=id
+  ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.13.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.13.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.13.ast
new file mode 100644
index 0000000..c78d170
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.13.ast
@@ -0,0 +1,38 @@
+DataverseUse TinySocial
+Query:
+SELECT ELEMENT [
+Variable [ Name=fbu ]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [FacebookUsers]
+  ]
+  AS
+  Variable [ Name=fbu ]
+]
+Where
+  QuantifiedExpression EVERY [
+    [Variable [ Name=e ]
+    In
+      FieldAccessor [
+        Variable [ Name=fbu ]
+        Field=employment
+      ]
+    ]
+    Satifies [
+      FunctionCall TinySocial.not@1[
+        FunctionCall TinySocial.is-null@1[
+          FieldAccessor [
+            Variable [ Name=e ]
+            Field=end-date
+          ]
+        ]
+      ]
+    ]
+  ]
+Orderby
+  FieldAccessor [
+    Variable [ Name=fbu ]
+    Field=id
+  ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.14.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.14.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.14.ast
new file mode 100644
index 0000000..443473e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.14.ast
@@ -0,0 +1,17 @@
+DataverseUse TinySocial
+Query:
+SELECT ELEMENT [
+FunctionCall TinySocial.count@1[
+  (
+    SELECT ELEMENT [
+    Variable [ Name=fbu ]
+    ]
+    FROM [      FunctionCall Metadata.dataset@1[
+        LiteralExpr [STRING] [FacebookUsers]
+      ]
+      AS
+      Variable [ Name=fbu ]
+    ]
+  )
+]
+]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.15.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.15.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.15.ast
new file mode 100644
index 0000000..d79d874
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.15.ast
@@ -0,0 +1,41 @@
+DataverseUse TinySocial
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [user]
+    :
+    Variable [ Name=uid ]
+  )
+  (
+    LiteralExpr [STRING] [count]
+    :
+    FunctionCall TinySocial.count@1[
+      Variable [ Name=t ]
+    ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [TweetMessages]
+  ]
+  AS
+  Variable [ Name=t ]
+]
+Groupby
+  Variable [ Name=uid ]
+  :=
+  FieldAccessor [
+    FieldAccessor [
+      Variable [ Name=t ]
+      Field=user
+    ]
+    Field=screen-name
+  ]
+  With
+  Variable [ Name=t ]
+
+Orderby
+  Variable [ Name=uid ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.16.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.16.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.16.ast
new file mode 100644
index 0000000..d79d874
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.16.ast
@@ -0,0 +1,41 @@
+DataverseUse TinySocial
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [user]
+    :
+    Variable [ Name=uid ]
+  )
+  (
+    LiteralExpr [STRING] [count]
+    :
+    FunctionCall TinySocial.count@1[
+      Variable [ Name=t ]
+    ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [TweetMessages]
+  ]
+  AS
+  Variable [ Name=t ]
+]
+Groupby
+  Variable [ Name=uid ]
+  :=
+  FieldAccessor [
+    FieldAccessor [
+      Variable [ Name=t ]
+      Field=user
+    ]
+    Field=screen-name
+  ]
+  With
+  Variable [ Name=t ]
+
+Orderby
+  Variable [ Name=uid ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.17.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.17.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.17.ast
new file mode 100644
index 0000000..3f22cd6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.17.ast
@@ -0,0 +1,48 @@
+DataverseUse TinySocial
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [user]
+    :
+    Variable [ Name=uid ]
+  )
+  (
+    LiteralExpr [STRING] [count]
+    :
+    Variable [ Name=c ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [TweetMessages]
+  ]
+  AS
+  Variable [ Name=t ]
+]
+Groupby
+  Variable [ Name=uid ]
+  :=
+  FieldAccessor [
+    FieldAccessor [
+      Variable [ Name=t ]
+      Field=user
+    ]
+    Field=screen-name
+  ]
+  With
+  Variable [ Name=t ]
+
+LetVariable [ Name=c ]
+  :=
+  FunctionCall TinySocial.count@1[
+    Variable [ Name=t ]
+  ]
+Orderby
+  Variable [ Name=c ]
+  ASC
+  Variable [ Name=uid ]
+  DESC
+
+Limit
+  LiteralExpr [LONG] [3]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.18.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.18.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.18.ast
new file mode 100644
index 0000000..04c2dfa
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.18.ast
@@ -0,0 +1,77 @@
+DataverseUse TinySocial
+Set simfunction=jaccard
+Set simthreshold=0.3
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [tweet]
+    :
+    Variable [ Name=t ]
+  )
+  (
+    LiteralExpr [STRING] [similar-tweets]
+    :
+    (
+      SELECT ELEMENT [
+      FieldAccessor [
+        Variable [ Name=t2 ]
+        Field=referred-topics
+      ]
+      ]
+      FROM [        FunctionCall Metadata.dataset@1[
+          LiteralExpr [STRING] [TweetMessages]
+        ]
+        AS
+        Variable [ Name=t2 ]
+      ]
+      Where
+        OperatorExpr [
+          OperatorExpr [
+            FieldAccessor [
+              Variable [ Name=t2 ]
+              Field=referred-topics
+            ]
+            ~=
+            FieldAccessor [
+              Variable [ Name=t ]
+              Field=referred-topics
+            ]
+          ]
+          and
+          OperatorExpr [
+            FieldAccessor [
+              Variable [ Name=t2 ]
+              Field=tweetid
+            ]
+            !=
+            FieldAccessor [
+              Variable [ Name=t ]
+              Field=tweetid
+            ]
+          ]
+        ]
+      Orderby
+        FieldAccessor [
+          Variable [ Name=t2 ]
+          Field=tweetid
+        ]
+        ASC
+
+    )
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [TweetMessages]
+  ]
+  AS
+  Variable [ Name=t ]
+]
+Orderby
+  FieldAccessor [
+    Variable [ Name=t ]
+    Field=tweetid
+  ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.19.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.19.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.19.ast
new file mode 100644
index 0000000..f36d0ea
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.19.ast
@@ -0,0 +1 @@
+DataverseUse TinySocial

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.2.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.2.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.2.ast
new file mode 100644
index 0000000..a6e2ec9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.2.ast
@@ -0,0 +1,5 @@
+DataverseUse TinySocial
+DatasetDecl FacebookUsers(FacebookUserType) partitioned by [[id]]
+DatasetDecl FacebookMessages(FacebookMessageType) partitioned by [[message-id]]
+DatasetDecl TwitterUsers(TwitterUserType) partitioned by [[screen-name]]
+DatasetDecl TweetMessages(TweetMessageType) partitioned by [[tweetid]]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.20.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.20.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.20.ast
new file mode 100644
index 0000000..aab796b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.20.ast
@@ -0,0 +1,18 @@
+DataverseUse TinySocial
+Query:
+SELECT ELEMENT [
+Variable [ Name=t ]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [TweetMessages]
+  ]
+  AS
+  Variable [ Name=t ]
+]
+Orderby
+  FieldAccessor [
+    Variable [ Name=t ]
+    Field=tweetid
+  ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.21.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.21.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.21.ast
new file mode 100644
index 0000000..f36d0ea
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.21.ast
@@ -0,0 +1 @@
+DataverseUse TinySocial

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.22.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.22.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.22.ast
new file mode 100644
index 0000000..f106f19
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.22.ast
@@ -0,0 +1,26 @@
+DataverseUse TinySocial
+Query:
+SELECT ELEMENT [
+FunctionCall TinySocial.count@1[
+  (
+    SELECT ELEMENT [
+    Variable [ Name=t ]
+    ]
+    FROM [      FunctionCall Metadata.dataset@1[
+        LiteralExpr [STRING] [TweetMessages]
+      ]
+      AS
+      Variable [ Name=t ]
+    ]
+    Where
+      OperatorExpr [
+        FieldAccessor [
+          Variable [ Name=t ]
+          Field=tweetid
+        ]
+        =
+        LiteralExpr [STRING] [13]
+      ]
+  )
+]
+]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.3.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.3.ast
new file mode 100644
index 0000000..f36d0ea
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.3.ast
@@ -0,0 +1 @@
+DataverseUse TinySocial

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.4.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.4.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.4.ast
new file mode 100644
index 0000000..760a841
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.4.ast
@@ -0,0 +1,20 @@
+DataverseUse TinySocial
+Query:
+SELECT ELEMENT [
+Variable [ Name=user ]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [FacebookUsers]
+  ]
+  AS
+  Variable [ Name=user ]
+]
+Where
+  OperatorExpr [
+    FieldAccessor [
+      Variable [ Name=user ]
+      Field=id
+    ]
+    =
+    LiteralExpr [LONG] [8]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.5.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.5.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.5.ast
new file mode 100644
index 0000000..2aa7368
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.5.ast
@@ -0,0 +1,38 @@
+DataverseUse TinySocial
+Query:
+SELECT ELEMENT [
+Variable [ Name=user ]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [FacebookUsers]
+  ]
+  AS
+  Variable [ Name=user ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=user ]
+        Field=id
+      ]
+      >=
+      LiteralExpr [LONG] [2]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=user ]
+        Field=id
+      ]
+      <=
+      LiteralExpr [LONG] [4]
+    ]
+  ]
+Orderby
+  FieldAccessor [
+    Variable [ Name=user ]
+    Field=id
+  ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.6.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.6.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.6.ast
new file mode 100644
index 0000000..ebb834b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.6.ast
@@ -0,0 +1,42 @@
+DataverseUse TinySocial
+Query:
+SELECT ELEMENT [
+Variable [ Name=user ]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [FacebookUsers]
+  ]
+  AS
+  Variable [ Name=user ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=user ]
+        Field=user-since
+      ]
+      >=
+      FunctionCall TinySocial.datetime@1[
+        LiteralExpr [STRING] [2010-07-22T00:00:00]
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=user ]
+        Field=user-since
+      ]
+      <=
+      FunctionCall TinySocial.datetime@1[
+        LiteralExpr [STRING] [2012-07-29T23:59:59]
+      ]
+    ]
+  ]
+Orderby
+  FieldAccessor [
+    Variable [ Name=user ]
+    Field=id
+  ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.7.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.7.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.7.ast
new file mode 100644
index 0000000..fc54b9d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.7.ast
@@ -0,0 +1,58 @@
+DataverseUse TinySocial
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [uname]
+    :
+    FieldAccessor [
+      Variable [ Name=user ]
+      Field=name
+    ]
+  )
+  (
+    LiteralExpr [STRING] [message]
+    :
+    FieldAccessor [
+      Variable [ Name=message ]
+      Field=message
+    ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [FacebookUsers]
+  ]
+  AS
+  Variable [ Name=user ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [FacebookMessages]
+  ]
+  AS
+  Variable [ Name=message ]
+]
+Where
+  OperatorExpr [
+    FieldAccessor [
+      Variable [ Name=message ]
+      Field=author-id
+    ]
+    =
+    FieldAccessor [
+      Variable [ Name=user ]
+      Field=id
+    ]
+  ]
+Orderby
+  FieldAccessor [
+    Variable [ Name=user ]
+    Field=name
+  ]
+  ASC
+  FieldAccessor [
+    Variable [ Name=message ]
+    Field=message-id
+  ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.8.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.8.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.8.ast
new file mode 100644
index 0000000..fc54b9d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.8.ast
@@ -0,0 +1,58 @@
+DataverseUse TinySocial
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [uname]
+    :
+    FieldAccessor [
+      Variable [ Name=user ]
+      Field=name
+    ]
+  )
+  (
+    LiteralExpr [STRING] [message]
+    :
+    FieldAccessor [
+      Variable [ Name=message ]
+      Field=message
+    ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [FacebookUsers]
+  ]
+  AS
+  Variable [ Name=user ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [FacebookMessages]
+  ]
+  AS
+  Variable [ Name=message ]
+]
+Where
+  OperatorExpr [
+    FieldAccessor [
+      Variable [ Name=message ]
+      Field=author-id
+    ]
+    =
+    FieldAccessor [
+      Variable [ Name=user ]
+      Field=id
+    ]
+  ]
+Orderby
+  FieldAccessor [
+    Variable [ Name=user ]
+    Field=name
+  ]
+  ASC
+  FieldAccessor [
+    Variable [ Name=message ]
+    Field=message-id
+  ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.9.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.9.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.9.ast
new file mode 100644
index 0000000..4f5ba43
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.9.ast
@@ -0,0 +1,64 @@
+DataverseUse TinySocial
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [uname]
+    :
+    FieldAccessor [
+      Variable [ Name=user ]
+      Field=name
+    ]
+  )
+  (
+    LiteralExpr [STRING] [messages]
+    :
+    (
+      SELECT ELEMENT [
+      FieldAccessor [
+        Variable [ Name=message ]
+        Field=message
+      ]
+      ]
+      FROM [        FunctionCall Metadata.dataset@1[
+          LiteralExpr [STRING] [FacebookMessages]
+        ]
+        AS
+        Variable [ Name=message ]
+      ]
+      Where
+        OperatorExpr [
+          FieldAccessor [
+            Variable [ Name=message ]
+            Field=author-id
+          ]
+          =
+          FieldAccessor [
+            Variable [ Name=user ]
+            Field=id
+          ]
+        ]
+      Orderby
+        FieldAccessor [
+          Variable [ Name=message ]
+          Field=message-id
+        ]
+        ASC
+
+    )
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [FacebookUsers]
+  ]
+  AS
+  Variable [ Name=user ]
+]
+Orderby
+  FieldAccessor [
+    Variable [ Name=user ]
+    Field=name
+  ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite/tinysocial-suite.24.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite/tinysocial-suite.24.ast
b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite/tinysocial-suite.24.ast
new file mode 100644
index 0000000..ee00dd5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tinysocial/tinysocial-suite/tinysocial-suite.24.ast
@@ -0,0 +1,86 @@
+DataverseUse TinySocial
+Query:
+SELECT [
+FieldAccessor [
+  Variable [ Name=user ]
+  Field=name
+]
+uname
+FieldAccessor [
+  Variable [ Name=user ]
+  Field=alias
+]
+alias
+FunctionCall TinySocial.substring@2[
+  FieldAccessor [
+    Variable [ Name=message ]
+    Field=message
+  ]
+  LiteralExpr [LONG] [30]
+]
+msg
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [FacebookMessages]
+  ]
+  AS
+  Variable [ Name=message ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [FacebookUsers]
+  ]
+  AS
+  Variable [ Name=user ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=message ]
+        Field=author-id
+      ]
+      =
+      FieldAccessor [
+        Variable [ Name=user ]
+        Field=id
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=message ]
+        Field=in-response-to
+      ]
+      >=
+      LiteralExpr [LONG] [1]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=message ]
+        Field=in-response-to
+      ]
+      <
+      LiteralExpr [LONG] [11]
+    ]
+  ]
+Orderby
+  FieldAccessor [
+    Variable [ Name=user ]
+    Field=name
+  ]
+  ASC
+  FieldAccessor [
+    Variable [ Name=user ]
+    Field=alias
+  ]
+  ASC
+  FunctionCall TinySocial.substring@2[
+    FieldAccessor [
+      Variable [ Name=message ]
+      Field=message
+    ]
+    LiteralExpr [LONG] [30]
+  ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml b/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index d289400..c7caed6 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -6231,6 +6231,11 @@
                 <output-dir compare="Text">tinysocial-suite</output-dir>
             </compilation-unit>
         </test-case>
+        <test-case FilePath="tinysocial">
+            <compilation-unit name="tinysocial-suite-open">
+                <output-dir compare="Text">tinysocial-suite-open</output-dir>
+            </compilation-unit>
+        </test-case>
     </test-group>
     <test-group name="types">
         <test-case FilePath="types">

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-app/src/test/resources/runtimets/testsuite_sqlpp_parser.xml
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/testsuite_sqlpp_parser.xml b/asterix-app/src/test/resources/runtimets/testsuite_sqlpp_parser.xml
index f21d7f7..6727bad 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite_sqlpp_parser.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite_sqlpp_parser.xml
@@ -6432,6 +6432,11 @@
                 <output-dir compare="AST">tinysocial-suite</output-dir>
             </compilation-unit>
         </test-case>
+        <test-case FilePath="tinysocial">
+            <compilation-unit name="tinysocial-suite-open">
+                <output-dir compare="AST">tinysocial-suite-open</output-dir>
+            </compilation-unit>
+        </test-case>
     </test-group>
     <test-group name="types">
         <test-case FilePath="types">

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/640b4480/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/Substring2TypeComputer.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/Substring2TypeComputer.java
b/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/Substring2TypeComputer.java
index d11caab..6cc2f6d 100644
--- a/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/Substring2TypeComputer.java
+++ b/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/Substring2TypeComputer.java
@@ -37,8 +37,9 @@ public class Substring2TypeComputer implements IResultTypeComputer {
     public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env,
             IMetadataProvider<?, ?> metadataProvider) throws AlgebricksException {
         AbstractFunctionCallExpression fce = (AbstractFunctionCallExpression) expression;
-        if (fce.getArguments().size() < 2)
+        if (fce.getArguments().size() < 2) {
             throw new AlgebricksException("Wrong Argument Number.");
+        }
         ILogicalExpression arg0 = fce.getArguments().get(0).getValue();
         ILogicalExpression arg1 = fce.getArguments().get(1).getValue();
         IAType t0, t1;
@@ -50,15 +51,22 @@ public class Substring2TypeComputer implements IResultTypeComputer {
         }
 
         ATypeTag tag0, tag1;
-        if (NonTaggedFormatUtil.isOptional(t0))
+        if (NonTaggedFormatUtil.isOptional(t0)) {
             tag0 = ((AUnionType) t0).getNullableType().getTypeTag();
-        else
+        } else {
             tag0 = t0.getTypeTag();
+        }
 
-        if (NonTaggedFormatUtil.isOptional(t1))
+        if (NonTaggedFormatUtil.isOptional(t1)) {
             tag1 = ((AUnionType) t1).getNullableType().getTypeTag();
-        else
+        } else {
             tag1 = t1.getTypeTag();
+        }
+
+        // Allow substring to work with ANY types, i.e., types that are unknown at compile
time.
+        if (tag0 == ATypeTag.ANY || tag1 == ATypeTag.ANY) {
+            return BuiltinType.ANY;
+        }
 
         if (tag0 != ATypeTag.NULL && tag0 != ATypeTag.STRING) {
             throw new AlgebricksException("First argument should be String Type.");



Mime
View raw message