Import CSV file from Google Cloud Storage to Google Cloud SQL

后端 未结 2 2073
[愿得一人]
[愿得一人] 2021-01-01 06:37

I am trying to import a csv file directly into Google Cloud SQL using the command below.

LOAD DATA LOCAL INFILE \"gs:/zuds/stg/ems/product_offering_fact/0000         


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-01 07:14

    Cloud SQL doesn't support running LOAD DATA LOCAL INFILE with "gs://" path. From the UI, as the doc suggests, only comma delimited files are supported at this point. Here are two workarounds:

    1. Transform your file to CSV and do an import through UI
    2. Download your gs:// file to your local disk and then run LOAD DATA LOCAL INFILE pointing to the path on your local disk.

提交回复
热议问题