asolimando commented on a change in pull request #2815:
URL: https://github.com/apache/hive/pull/2815#discussion_r756727876



##########
File path: ql/src/test/queries/clientpositive/cbo_case_when_wrong_type.q
##########
@@ -0,0 +1,20 @@
+create external table test_case (row_seq smallint, row_desc string) stored as 
parquet;

Review comment:
       Sure, would you prefer a separate qtest file or to integrate it into 
this one?
   
   EDIT: or maybe you meant to replace the existing with this one altogether?
   
   In case I would write the following:
   
   ```
   create table t (a smallint, b string);
   insert into t values (1, 'a');
   insert into t values (2, 'aa');
   insert into t values (6, 'aaaaaa');
   
   select 1 from t where a in (1,2,3) and case a when 1 then true when 2 then 
true end;
   explain cbo select 1 from t where a in (1,2,3) and case a when 1 then true 
when 2 then true end;
   
   select 1 from t where a in (1,2,3) and case when a = 1 then true when a = 2 
then true end;
   explain cbo select 1 from t where a in (1,2,3) and case when a = 1 then true 
when a = 2 then true end;
   ```
   So that we also compare against the syntactical variant of `case ... when` 
which does not pose problems. W.r.t. your example I dropped the "S" in the 
constants, otherwise the problem was not reproducible, constants would be typed 
as `SMALLINT`.




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