Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Why does CTAS loss precision scale information?

I have created a table in Bigquery with BIGNUMERIC data type by defining precision and scale like below.  

 

CREATE TABLE test.delete_me (bignumeric BIGNUMERIC (37, 2));
INSERT INTO test.delete_me VALUES (12.78);

 

 
krvikash_0-1718007680447.png

Now When I try to use the CTAS (Create Table As Select) query, Then the newly created table loses the precision and scale information for the column. 

 

CREATE TABLE test.delete_me_2 AS SELECT * FROM test.delete_me;

 

krvikash_1-1718007873703.png

I tried creating VIEW as well and the same issue is happening. Is this the issue expected?

0 0 103
0 REPLIES 0