fix issue208
git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_stabilization_printerfix@960 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-app/data/twitter/tw_messages.adm b/asterix-app/data/twitter/tw_messages.adm
new file mode 100644
index 0000000..88f5e24
--- /dev/null
+++ b/asterix-app/data/twitter/tw_messages.adm
@@ -0,0 +1,10 @@
+{"tweetid":"1","tweetid-copy":"1","user":{"screen-name":"RollandEckhardstein#211","lang":"en","friends_count":3657079,"statuses_count":268,"name":"Rolland Eckhardstein","followers_count":3311368},"sender-location":point("42.13,80.43"),"send-time":datetime("2005-12-05T21:06:41"),"send-time-copy":datetime("2005-12-05T21:06:41"),"referred-topics":{{"samsung","plan"}},"message-text":" love samsung the plan is amazing"}
+{"tweetid":"2","tweetid-copy":"2","user":{"screen-name":"RollandEckhardstein#211","lang":"en","friends_count":3657079,"statuses_count":268,"name":"David Eckhardstein","followers_count":3311368},"sender-location":point("28.86,70.44"),"send-time":datetime("2007-08-15T06:44:17"),"send-time-copy":datetime("2007-08-15T06:44:17"),"referred-topics":{{"sprint","voice-clarity"}},"message-text":" like sprint its voice-clarity is mind-blowing"}
+{"tweetid":"3","tweetid-copy":"3","user":{"screen-name":"RollandEckhard#500","lang":"en","friends_count":3657079,"statuses_count":268,"name":"Rolland Hetfield","followers_count":3311368},"sender-location":point("39.84,86.48"),"send-time":datetime("2008-12-24T00:07:04"),"send-time-copy":datetime("2008-12-24T00:07:04"),"referred-topics":{{"verizon","voice-command"}},"message-text":" can't stand verizon its voice-command is terrible:("}
+{"tweetid":"4","tweetid-copy":"4","user":{"screen-name":"RollandEckhardstein#221","lang":"en","friends_count":3657079,"statuses_count":268,"name":"Rolland Eckhardstinz","followers_count":3311368},"sender-location":point("27.67,87.32"),"send-time":datetime("2007-02-05T16:39:13"),"send-time-copy":datetime("2007-02-05T16:39:13"),"referred-topics":{{"t-mobile","customer-service"}},"message-text":" love t-mobile its customer-service is mind-blowing"}
+{"tweetid":"5","tweetid-copy":"5","user":{"screen-name":"RollandEcstein#211","lang":"en","friends_count":3657079,"statuses_count":268,"name":"Rolland Eckhardst","followers_count":3311368},"sender-location":point("27.3,92.77"),"send-time":datetime("2010-09-12T06:15:28"),"send-time-copy":datetime("2010-09-12T06:15:28"),"referred-topics":{{"t-mobile","customization"}},"message-text":" like t-mobile the customization is amazing:)"}
+{"tweetid":"6","tweetid-copy":"6","user":{"screen-name":"Rollkhardstein#211","lang":"en","friends_count":3657079,"statuses_count":268,"name":"Kirk Hammette ","followers_count":3311368},"sender-location":point("45.62,84.78"),"send-time":datetime("2012-01-23T06:23:13"),"send-time-copy":datetime("2012-01-23T06:23:13"),"referred-topics":{{"iphone","network"}},"message-text":" like iphone its network is awesome:)"}
+{"tweetid":"7","tweetid-copy":"7","user":{"screen-name":"andEckhardstein#211","lang":"en","friends_count":3657079,"statuses_count":268,"name":"Rolland khardstein","followers_count":3311368},"sender-location":point("44.12,81.46"),"send-time":datetime("2012-02-17T17:30:26"),"send-time-copy":datetime("2012-02-17T17:30:26"),"referred-topics":{{"t-mobile","network"}},"message-text":" hate t-mobile the network is bad"}
+{"tweetid":"8","tweetid-copy":"8","user":{"screen-name":"Rolltein#211","lang":"en","friends_count":3657079,"statuses_count":268,"name":"Ron Eckhardstein","followers_count":3311368},"sender-location":point("36.86,90.71"),"send-time":datetime("2009-03-12T13:18:04"),"send-time-copy":datetime("2009-03-12T13:18:04"),"referred-topics":{{"at&t","touch-screen"}},"message-text":" dislike at&t its touch-screen is OMG"}
+{"tweetid":"9","tweetid-copy":"9","user":{"screen-name":"Roldstein#211","lang":"en","friends_count":3657079,"statuses_count":268,"name":"Rolland Eckdstein","followers_count":3311368},"sender-location":point("29.07,97.05"),"send-time":datetime("2012-08-15T20:19:46"),"send-time-copy":datetime("2012-08-15T20:19:46"),"referred-topics":{{"verizon","speed"}},"message-text":" hate verizon its speed is bad"}
+{"tweetid":"10","tweetid-copy":"10","user":{"screen-name":"Rolldstein#211","lang":"en","friends_count":3657079,"statuses_count":268,"name":"Rolland Eckhardstful","followers_count":3311368},"sender-location":point("46.94,93.98"),"send-time":datetime("2011-04-07T14:08:46"),"send-time-copy":datetime("2011-04-07T14:08:46"),"referred-topics":{{"t-mobile","signal"}},"message-text":" like t-mobile the signal is good"}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue208.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue208.aql
new file mode 100644
index 0000000..7e7d12e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue208.aql
@@ -0,0 +1,38 @@
+drop dataverse OpenSocialNetworkData if exists;
+create dataverse OpenSocialNetworkData;
+
+use dataverse OpenSocialNetworkData;
+
+create type TwitterUserType as open {
+screen-name: string,
+lang: string,
+friends_count: int32,
+statuses_count: int32,
+name: string,
+followers_count: int32
+}
+
+create type TweetMessageType as open {
+tweetid: string,
+tweetid-copy: string,
+send-time-copy: datetime
+}
+
+create dataset TweetMessages(TweetMessageType)
+partitioned by key tweetid;
+
+load dataset TweetMessages
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/twitter/tw_messages.adm"),("format"="adm"));
+
+write output to nc1:"rttest/open-closed_query-issue208.adm";
+for $t in dataset('TweetMessages')
+where $t.send-time >= datetime('2005-04-13T17:17:22') and
+$t.send-time <= datetime('2011-04-13T17:18:22')
+group by $uid := $t.user.screen-name with $t
+order by $uid
+return {
+ "user": $uid,
+ "count": count($t)
+}
+
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue208.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue208.adm
new file mode 100644
index 0000000..14c1c18
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue208.adm
@@ -0,0 +1,6 @@
+{ "count": 1, "user": "RollandEckhard#500" }
+{ "count": 2, "user": "RollandEckhardstein#211" }
+{ "count": 1, "user": "RollandEckhardstein#221" }
+{ "count": 1, "user": "RollandEcstein#211" }
+{ "count": 1, "user": "Rolldstein#211" }
+{ "count": 1, "user": "Rolltein#211" }
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index 2e4f590..384983d 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -2324,6 +2324,11 @@
<output-file compare="Text">query-issue166.adm</output-file>
</compilation-unit>
</test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="query-issue208">
+ <output-file compare="Text">query-issue208.adm</output-file>
+ </compilation-unit>
+ </test-case>
<!--
<test-case FilePath="open-closed">
<compilation-unit name="open-closed-15">
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedFieldAccessByNameResultType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedFieldAccessByNameResultType.java
index 4b8b32a9..36ad7e7 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedFieldAccessByNameResultType.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedFieldAccessByNameResultType.java
@@ -8,8 +8,8 @@
import edu.uci.ics.asterix.om.types.AUnionType;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.runtime.pointables.base.DefaultOpenFieldType;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalExpressionTag;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
@@ -58,7 +58,7 @@
return (ARecordType) type0;
}
case ANY: {
- throw new NotImplementedException();
+ return DefaultOpenFieldType.NESTED_OPEN_RECORD_TYPE;
}
case UNION: {
AUnionType u = (AUnionType) type0;