Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Running this query I was trying to test the behavior of the test framework to allow checking a baseline file, without providing type information for each column in a csv. The idea is that the types that come out of the test query can drive the interpretation of the baseline where strict type checking isn't necessary. Unfortunately I ran into a bug when I was trying to make sure decimal scale and precision could be retrieved from a result set with a decimal column. It appears that the two values are being switched somewhere in the process of running a cast. I plan on fixing this soon, but wanted to create a JIRA to track the issue so I can post the patch for the test framework for review.
To replicate:
select cast(dec_col as decimal(38,2)) dec_col from cp.`testframework/decimal_test.json`
The file need only contain a single decimal in a field called dec_col in the input file. I used a value of "3.7"