Syntax error in CQL query (Cassandra CQL COPY FROM command): "invalid input"

When trying to upload a tabbed CSV file, I get the following error in the Cassandra table:

ErrorMessage code = 2000 [Syntax error in CQL query] message = "line 1: 747 invalid input '-800' Waiting ')' (... facebook, '2014-01-01 00: 00: 00', 0, ' 0 ', 1 [-800] -...) "Cancel import in record # 1. inserted records are still present, and some records after that may be present as well.

The file is a 62 column section delimited file which I am trying to load via the following statement

COPY alpha_table 
(a,al,e,p,b,ag,ab,au,l,m,aq,aw,g,af,am,s,aj,aa,ad,ak,ah,h,be,y,bh,z,ay,az,as,bi,av,n,v,ac,k,j,x,ax,f,ao,an,o,u,d,ai,bf,ap,bg,i,ar,c,t,bd,bj,at,bc,ba,bb,ae,r,w,q) 
FROM '/tmp/data.csv' WITH DELIMITER='\t'

      

The table has a combination of int and text fields as follows

CREATE TABLE alpha_table ( a int PRIMARY KEY, al text, e int, p text, b int, ag text, ab int, au text, l int, m int, aq text, aw int, g text, af int, am text, s int, aj text, aa int, ad int, ak int, ah text, h text, be text, y int, bh int, z text, ay int, az int, as int, bi int, av int, n text, v int, ac int, k text, j text, x int, ax int, f text, ao text, an text, o int, u int, d text, ai text, bf text, ap int, bg int, i text, ar int, c text, t int, bd text, bj text, at text, bc int, ba int, bb int, ae int, r text, w int, q text)

      

The data file contains 100 records that differ only in the identifier in the first column and are otherwise identical.

1000001 "30214" "Abe House of Chow"   "Abe House of Chow"   1   "N" "Macon Mall newest restaurant, Abes House of Chow is holding its official grand opening October 1 2014. City leaders and the owners of the restaurant will gather for the ribbon cutting ceremony as they expect more than more than 500 people at the event. The restaurant sells nearly 8 thousand pulled pork sandwiches a week."  "0" "never leave hungry"    "free wings if you like us on facebook" "2014-01-01 00:00:00"   "0" "0" "1-800-CHOWDWN" 5   "kia"   "f8FJdaM1dYE"   "0" 1   1   1   0   0   0   "0" "HU"    "0" "0" "0" "0" "0" "30"    "0" "abes-house-of-chow"    "Y94L"  "#abeshouseofchow"  0   "2012-06-14 00:00:00"   "2015-03-16 15:20:44"   "2014-01-11 11:15:58"   "abe"   "-3"    "0" 8   "0" "C" "2012-06-14 00:00:00"   "0" "0" "0" 1   1   1   1   "0" "N" "en"    "U" 0

      

The weird thing about this error is that when I try to insert all 100, I get an error, but if I only create a new file from the first 20, I won't. Oddly enough, in any case, he will say that the records were inserted regardless of whether they were or not.

cqlsh: alpha_keyspace> COPY alpha_table (A, al, e, p, b, Ag, AB, AC, l, m, aqueous solution, ab, g, af, at, s, ai aa, ads, ak, ah, h , will be, y, bh, z, ay, az, since, bi, av, n, v, ac, k, j, x, ah, f, ao, an, o, y, d, ar , Bf, ap, bg, i, ap, s, t, d, b, c, bc, ba, bb, ae, g, w, d) FROM '/tmp/data_100.csv' WITH DELIMITER = '\ t';

ErrorMessage code = 2000 [Syntax error in CQL query] message = "line 1: 747 invalid input '-800' Waiting ')' (... facebook, '2014-01-01 00: 00: 00', 0, ' 0 ', 1 [-800] -...) "Cancel import in record # 1. inserted records are still present, and some records after that may be present as well.

100 lines imported in 0.126 seconds.

cqlsh: alpha_keyspace> COPY alpha_table (A, al, e, p, b, Ag, AB, AC, l, m, aqueous solution, ab, g, af, at, s, ai aa, ads, ak, ah, h , will be, y, bh, z, ay, az, since, bi, av, n, v, ac, k, j, x, ah, f, ao, an, o, y, d, ar , Bf, ap, bg, i, ap, s, t, d, b, c, bc, ba, bb, ae, g, w, d) FROM '/tmp/data_20.csv' WITH DELIMITER = '\ t';

20 lines imported in 0.122 seconds

I am using cqlsh 5.0.1 against my local Cassandra 2.1.8 instance. Any help would be greatly appreciated.

+3


source to share





All Articles