Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

114
Views
Retaining schema when unloading Snowflake table to s3 in parquet

My table on Snowflake contains a field created as INT and defaults to NUMBER(38,0) as Snowflake data type.

When I unload this table to s3 in parquet format with COPY command, I expect to retain the whole schema including the precision of this field. However, the resulting parquet has INT32 Decimal(precision=9, scale=0).

In Snowflake documentation, it is mentioned that

/* To retain the table schema in the output file, use a simple SELECT statement (e.g. SELECT * FROM cities). */

However, my query below does not keep the precision intact.

COPY INTO @staging.dl_stage/prediction/vehicle/export_date=20200226/file 
FROM (
    SELECT * FROM  snd_staging.PREDICTION.vehicle
)
  FILE_FORMAT=(type='parquet' COMPRESSION = AUTO)
  HEADER = TRUE
  OVERWRITE = TRUE
  SINGLE = False
  MAX_FILE_SIZE=256000000;

Is it possible to force keeping Snowflake data type precision intact?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I eventually solved this by running this:

alter session set ENABLE_UNLOAD_PHYSICAL_TYPE_OPTIMIZATION = false; 
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!