drill-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandeep Dugar <sdu...@gainsight.com>
Subject Re: Question related to escaping in create table as for CSV
Date Mon, 19 Sep 2016 06:51:20 GMT
Hi,

Please let me know if there is any setting or workaround for this.

-
Thanks,
Sandeep

> On Aug 29, 2016, at 6:18 PM, Sandeep Dugar <sdugar@gainsight.com> wrote:
> 
> Input csv (filename: input.csv):
> 
> "Id","customer_id__c","first_name__c","last_name__c","email__c","address__c","city__c","state__c","zipcode__c","careOf__c"
> "a1T410000004uG6EAI",1.0,"George","Washington","gwashington@usa.gov <mailto:gwashington@usa.gov>","3200
Mt Vernon Hwy","Mount Vernon","VA",22121.0,"!@Satya__ , ()"
> 
> 
> 
> create table as query:
> 
> create table <<storageplugin>>.<<workspace>>.`output.csv` as
select * from <<storageplugin>>.<<workspace>>.`input.csv`
> 
> 
> Resultant output (i.e. output.csv):
> 
> Id,customer_id__c,first_name__c,last_name__c,email__c,address__c,city__c,state__c,zipcode__c,careOf__c
> a1T410000004uG6EAI,1.0,George,Washington,gwashington@usa.gov <mailto:gwashington@usa.gov>,3200
Mt Vernon Hwy,Mount Vernon,VA,22121.0,!@Satya__ , ()
> 
> 
> Problem:
> - The create table as output csv does not have columns separated by quotes
> - The next query on this output fails. For eg. in the below output for column careOf__c
the data is not complete because of the comma
> 
> +---------------------+----------------+---------------+
> |         Id          | first_name__c  |   careOf__c   |
> +---------------------+----------------+---------------+
> | a1T410000004uG6EAI  | George         | !@Satya__ \\  |
> +---------------------+----------------+---------------+
> 
> 
> 
> Two questions:
> 1. Is there a way to specify "create table as" output csv to have each column separated
by double quotes?
> 2. If there is no way we can specify point 1, is there a way to escape "comma" in the
create table output?


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message