dharanad commented on code in PR #12259:
URL: https://github.com/apache/datafusion/pull/12259#discussion_r1739771072


##########
datafusion/sqllogictest/test_files/map.slt:
##########
@@ -482,23 +482,28 @@ SELECT MAP { 'a': 1, 2: 3 };
 ----
 {a: 1, 2: 3}
 
-# TODO(https://github.com/apache/datafusion/issues/11785): fix accessing map 
with non-string key
-# query ?
-# SELECT MAP { 1: 'a', 2: 'b', 3: 'c' }[1];
-# ----
-# a
+
+query T
+SELECT MAP { 1: 'a', 2: 'b', 3: 'c' }[1];
+----
+a
 
 # TODO(https://github.com/apache/datafusion/issues/11785): fix accessing map 
with non-string key
 # query ?
 # SELECT MAP { MAP {1:'a', 2:'b'}:1, MAP {1:'c', 2:'d'}:2 }[MAP {1:'a', 
2:'b'}];
 # ----
 # 1
 
-# TODO(https://github.com/apache/datafusion/issues/11785): fix accessing map 
with non-string key
-# query ?
-# SELECT MAKE_MAP(1, null, 2, 33, 3, null)[2];
-# ----
-# 33
+query I
+SELECT MAKE_MAP(1, null, 2, 33, 3, null)[2];
+----
+33
+
+query T
+SELECT MAP { 1.0: 'a', 2.0: 'b', 3.0: 'c' }[2.0];
+----
+b
+

Review Comment:
   Current implmentation will throw an error. Just checked DuckDB, it try to 
cast the index to keys data type.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to