liukun4515 commented on issue #1488:
URL: 
https://github.com/apache/arrow-datafusion/issues/1488#issuecomment-1002922919


   > @liukun4515 thanks for the help looking into this.
   > 
   > I'm aligned with your thinking - but it does seem something else is still 
off. below is the head of the csv file. the float field is not quoted.
   > 
   > ```
   > $ head -n 25 J1_1e7_NA_0_0.csv
   > id1,id2,id3,id4,id5,id6,v1
   > 10,5159,8771892,id10,id5159,id8771892,91.827108
   > 7,8469,6597185,id7,id8469,id6597185,48.147306
   > 6,7510,10742226,id6,id7510,id10742226,53.125234
   > 10,3114,4468842,id10,id3114,id4468842,96.488041
   > 3,6139,7725507,id3,id6139,id7725507,56.095139
   > 8,5330,3935410,id8,id5330,id3935410,0.349572
   > 10,9278,1617200,id10,id9278,id1617200,68.425456
   > 3,2328,9892050,id3,id2328,id9892050,62.356196
   > 4,4500,4713401,id4,id4500,id4713401,57.149024
   > 3,1782,2296556,id3,id1782,id2296556,94.777187
   > 3,8728,5951049,id3,id8728,id5951049,67.679287
   > 8,4718,9297336,id8,id4718,id9297336,24.238334
   > 11,8211,5318127,id11,id8211,id5318127,66.530629
   > 2,2709,8769384,id2,id2709,id8769384,52.903976
   > 3,5280,1083694,id3,id5280,id1083694,12.481477
   > 8,2883,9801933,id8,id2883,id9801933,49.100595
   > 2,8989,6380263,id2,id8989,id6380263,40.005564
   > 11,9768,9715707,id11,id9768,id9715707,40.54798
   > 5,10744,9149552,id5,id10744,id9149552,3.472602
   > 6,1194,6141889,id6,id1194,id6141889,3.986312
   > 5,1270,7381972,id5,id1270,id7381972,98.386565
   > 4,8238,1702432,id4,id8238,id1702432,81.020402
   > 4,8459,6190403,id4,id8459,id6190403,87.17891
   > 11,205,9363336,id11,id205,id9363336,94.937556
   > ```
   
   I have copy your data to my laptop and repeat your steps.
   
   1. copy your data and store as the csv file whose name is `simple.csv`
   2. create table `CREATE EXTERNAL TABLE food  STORED AS CSV WITH HEADER ROW 
LOCATION 'simple.csv';`
   3. desc the table `\d food`
   below is my result 
   ```
   ❯ \d food
   
+---------------+--------------+------------+-------------+-----------+-------------+
   | table_catalog | table_schema | table_name | column_name | data_type | 
is_nullable |
   
+---------------+--------------+------------+-------------+-----------+-------------+
   | datafusion    | public       | food       | id1         | Int64     | NO   
       |
   | datafusion    | public       | food       | id2         | Int64     | NO   
       |
   | datafusion    | public       | food       | id3         | Int64     | NO   
       |
   | datafusion    | public       | food       | id4         | Utf8      | NO   
       |
   | datafusion    | public       | food       | id5         | Utf8      | NO   
       |
   | datafusion    | public       | food       | id6         | Utf8      | NO   
       |
   | datafusion    | public       | food       | v1          | Float64   | NO   
       |
   
+---------------+--------------+------------+-------------+-----------+-------------+
   7 rows in set.
   ```
   the result of query `select * from food limit 2`
   ```
   ❯ select * from food limit 2
   ;
   +-----+------+---------+------+--------+-----------+-----------+
   | id1 | id2  | id3     | id4  | id5    | id6       | v1        |
   +-----+------+---------+------+--------+-----------+-----------+
   | 10  | 5159 | 8771892 | id10 | id5159 | id8771892 | 91.827108 |
   | 7   | 8469 | 6597185 | id7  | id8469 | id6597185 | 48.147306 |
   +-----+------+---------+------+--------+-----------+-----------+
   2 rows in set. Query took 0.015 seconds.
   ❯
   ```
   @matthewmturner 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to