kasakrisz commented on code in PR #5702:
URL: https://github.com/apache/hive/pull/5702#discussion_r2003193644


##########
ql/src/test/queries/clientpositive/complex_type_to_string.q:
##########
@@ -0,0 +1,31 @@
+create table table1(id int, txt string, num int, flag string);

Review Comment:
   Could you please add some test cases where complex types are nested?
   ```
   struct {
     a map<string, array<int>>,
     b struct { c decimal(10,3), d double}
   }
   ```



##########
ql/src/test/queries/clientpositive/complex_type_to_string.q:
##########
@@ -0,0 +1,31 @@
+create table table1(id int, txt string, num int, flag string);
+create table table2(id int, txt string, num int, flag boolean);
+
+insert into  table1 values
+  (1, 'one',   5, 'FALSE'),
+  (2, 'two',  14, 'TRUE'),
+  (3,  NULL,   3, 'FALSE');
+insert into  table2 values
+  (1, 'one',   5, 'FALSE'),
+  (2, 'two',  14, 'TRUE'),
+  (3,  NULL,   3, 'FALSE');
+  
+select cast(array(*) as string) from table1;
+select cast(array(*) as string) from table2;

Review Comment:
   Could you please add these tests to 
[udf_to_string.q](https://github.com/apache/hive/blob/master/ql/src/test/queries/clientpositive/udf_to_string.q)
 file? I think we don't need a separate q file. WDYT?



##########
ql/src/test/queries/clientpositive/complex_type_to_string.q:
##########
@@ -0,0 +1,31 @@
+create table table1(id int, txt string, num int, flag string);
+create table table2(id int, txt string, num int, flag boolean);
+
+insert into  table1 values
+  (1, 'one',   5, 'FALSE'),
+  (2, 'two',  14, 'TRUE'),
+  (3,  NULL,   3, 'FALSE');
+insert into  table2 values
+  (1, 'one',   5, 'FALSE'),
+  (2, 'two',  14, 'TRUE'),
+  (3,  NULL,   3, 'FALSE');
+  
+select cast(array(*) as string) from table1;
+select cast(array(*) as string) from table2;
+select md5(s) csum from (select cast(array(*) as string) s from table1) t;
+select md5(s) csum from (select cast(array(*) as string) s from table2) t;

Review Comment:
   These tests pass a `string` to the `md5` function. I don't think it is 
necessary to test it because we already have test for that in 
[udf_md5.q](https://github.com/apache/hive/blob/master/ql/src/test/queries/clientpositive/udf_md5.q)
   Please let me know if there is something else that these tests cover.
   
   Do we want to support `md5 ` with complex type parameter? I think it is out 
of scope of this patch.



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to