You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Pushkar Prasad <pu...@airtightnetworks.net> on 2013/03/01 17:08:36 UTC
COPY command not working
Hi,
I am unable to run the COPY command in cassandra. Here is the ColumnFamily
that I am using
CREATE TABLE ap_perf_sample_data_tbl(
ap_mac varchar,
ap_proto int,
stime int,
ap_active_status int,
bytes_from_dev int,
bytes_to_dev int,
location_id int,
num_assocs int,
num_data_pkts int,
num_retry_pkts int,
throughput_from_ap int,
throughput_to_ap int,
throughput_total_ap int,
time_spent_on_channel int,
time_util_by_ap int,
PRIMARY KEY ((ap_mac, ap_proto), stime)
I'm trying to use the COPY command in cqlsh as follows:
cqlsh:performance_data> copy ap_perf_sample_data_tbl (ap_mac, ap_proto ,
stime, location_id, num_data_pkts, num_retry_pkts, num_assocs,
time_util_by_ap, time_spent_on_channel, throughput_to_ap,
throughput_from_ap, throughput_total_ap, bytes_to_dev, bytes_from_dev
,ap_active_status) from '/tmp/top';
Bad Request: Invalid STRING constant (1) for ap_proto of type int
Aborting import at record #0 (line 1).
Previously-inserted values still present.
0 rows imported in 0.008 seconds.
cqlsh:performance_data>
Contents of "/tmp/top"
00:00:01:00:01:00,1,1359532800,1,6002166,312781,10,845100,9045000,259143,241
011,52835,186318,5413799,10
00:00:02:00:02:00,1,1359532800,2,6002166,312781,10,845100,9045000,259143,241
011,52835,186318,5413799,10
00:00:03:00:03:00,1,1359532800,3,6002166,312781,10,845100,9045000,259143,241
011,52835,186318,5413799,10
00:00:04:00:04:00,1,1359532800,4,6002166,312781,10,845100,9045000,259143,241
011,52835,186318,5413799,10
Following is the version information.
[root@localhost ~]# cqlsh Connected to Test Cluster at localhost:9160.
[cqlsh 2.3.0 | Cassandra 1.2.2 | CQL spec 3.0.0 | Thrift protocol 19.35.0]
Use HELP for help.
Any clues as to why this may happen will be appreciated.
Thanks
Pushkar Prasad
RE: COPY command not working
Posted by Pushkar Prasad <pu...@airtightnetworks.net>.
Aleksey,
Thanks for the update. Can you tell me if there is any workaround for this?
I want to use compound keys, and want to use COPY command.
Thanks
Pushkar
-----Original Message-----
From: Aleksey Yeschenko [mailto:aleksey@yeschenko.com]
Sent: 01 March 2013 23:12
To: dev@cassandra.apache.org
Cc: Pushkar Prasad
Subject: Re: COPY command not working
This is being caused by stricter validation in 1.2.2.
I opened a ticket https://issues.apache.org/jira/browse/CASSANDRA-5305 -
thanks for the report.
--
AY
On Friday, March 1, 2013 at 19:08 PM, Pushkar Prasad wrote:
> Hi,
>
> I am unable to run the COPY command in cassandra. Here is the ColumnFamily
> that I am using
>
> CREATE TABLE ap_perf_sample_data_tbl(
> ap_mac varchar,
> ap_proto int,
> stime int,
> ap_active_status int,
> bytes_from_dev int,
> bytes_to_dev int,
> location_id int,
> num_assocs int,
> num_data_pkts int,
> num_retry_pkts int,
> throughput_from_ap int,
> throughput_to_ap int,
> throughput_total_ap int,
> time_spent_on_channel int,
> time_util_by_ap int,
> PRIMARY KEY ((ap_mac, ap_proto), stime)
>
> I'm trying to use the COPY command in cqlsh as follows:
>
> cqlsh:performance_data> copy ap_perf_sample_data_tbl (ap_mac, ap_proto ,
> stime, location_id, num_data_pkts, num_retry_pkts, num_assocs,
> time_util_by_ap, time_spent_on_channel, throughput_to_ap,
> throughput_from_ap, throughput_total_ap, bytes_to_dev, bytes_from_dev
> ,ap_active_status) from '/tmp/top';
>
> Bad Request: Invalid STRING constant (1) for ap_proto of type int
> Aborting import at record #0 (line 1).
> Previously-inserted values still present.
> 0 rows imported in 0.008 seconds.
> cqlsh:performance_data>
>
>
> Contents of "/tmp/top"
>
>
00:00:01:00:01:00,1,1359532800,1,6002166,312781,10,845100,9045000,259143,241
> 011,52835,186318,5413799,10
>
00:00:02:00:02:00,1,1359532800,2,6002166,312781,10,845100,9045000,259143,241
> 011,52835,186318,5413799,10
>
00:00:03:00:03:00,1,1359532800,3,6002166,312781,10,845100,9045000,259143,241
> 011,52835,186318,5413799,10
>
00:00:04:00:04:00,1,1359532800,4,6002166,312781,10,845100,9045000,259143,241
> 011,52835,186318,5413799,10
>
>
> Following is the version information.
>
> [root@localhost ~]# cqlsh Connected to Test Cluster at localhost:9160.
> [cqlsh 2.3.0 | Cassandra 1.2.2 | CQL spec 3.0.0 | Thrift protocol 19.35.0]
> Use HELP for help.
>
>
>
> Any clues as to why this may happen will be appreciated.
>
> Thanks
> Pushkar Prasad
>
>
>
Re: COPY command not working
Posted by Aleksey Yeschenko <al...@yeschenko.com>.
This is being caused by stricter validation in 1.2.2.
I opened a ticket https://issues.apache.org/jira/browse/CASSANDRA-5305 - thanks for the report.
--
AY
On Friday, March 1, 2013 at 19:08 PM, Pushkar Prasad wrote:
> Hi,
>
> I am unable to run the COPY command in cassandra. Here is the ColumnFamily
> that I am using
>
> CREATE TABLE ap_perf_sample_data_tbl(
> ap_mac varchar,
> ap_proto int,
> stime int,
> ap_active_status int,
> bytes_from_dev int,
> bytes_to_dev int,
> location_id int,
> num_assocs int,
> num_data_pkts int,
> num_retry_pkts int,
> throughput_from_ap int,
> throughput_to_ap int,
> throughput_total_ap int,
> time_spent_on_channel int,
> time_util_by_ap int,
> PRIMARY KEY ((ap_mac, ap_proto), stime)
>
> I'm trying to use the COPY command in cqlsh as follows:
>
> cqlsh:performance_data> copy ap_perf_sample_data_tbl (ap_mac, ap_proto ,
> stime, location_id, num_data_pkts, num_retry_pkts, num_assocs,
> time_util_by_ap, time_spent_on_channel, throughput_to_ap,
> throughput_from_ap, throughput_total_ap, bytes_to_dev, bytes_from_dev
> ,ap_active_status) from '/tmp/top';
>
> Bad Request: Invalid STRING constant (1) for ap_proto of type int
> Aborting import at record #0 (line 1).
> Previously-inserted values still present.
> 0 rows imported in 0.008 seconds.
> cqlsh:performance_data>
>
>
> Contents of "/tmp/top"
>
> 00:00:01:00:01:00,1,1359532800,1,6002166,312781,10,845100,9045000,259143,241
> 011,52835,186318,5413799,10
> 00:00:02:00:02:00,1,1359532800,2,6002166,312781,10,845100,9045000,259143,241
> 011,52835,186318,5413799,10
> 00:00:03:00:03:00,1,1359532800,3,6002166,312781,10,845100,9045000,259143,241
> 011,52835,186318,5413799,10
> 00:00:04:00:04:00,1,1359532800,4,6002166,312781,10,845100,9045000,259143,241
> 011,52835,186318,5413799,10
>
>
> Following is the version information.
>
> [root@localhost ~]# cqlsh Connected to Test Cluster at localhost:9160.
> [cqlsh 2.3.0 | Cassandra 1.2.2 | CQL spec 3.0.0 | Thrift protocol 19.35.0]
> Use HELP for help.
>
>
>
> Any clues as to why this may happen will be appreciated.
>
> Thanks
> Pushkar Prasad
>
>
>