Hi,
I have a tab separatd file with a number of columns.
Columns 5 and 6 are the date as yyyy-mm-dd and hh24:mi:ss
I want to add rows with a composite key that consists of an UTF8Type and the
DateType (which are fields 5 and 6).
The column family is :
CREATE COLUMN FAMILY traffic
WITH comparator = 'CompositeType(UTF8Type,UTF8Type)' and
key_validation_class='CompositeType(UTF8Type,DateType)'
AND column_metadata = [ {column_name: fac, validation_class: UTF8Type,
index_type : 0, index_name : fac_idx }]
How can I insert rows with a composite key : field 0 + the combined fields 5
and 6 of the rows.
Below a small piece of the code:
b=cf.batch(queue_size=10000)
with open ('xxx.csv') as csvfile:
spamreader=csv.reader(csvfile,delimiter='\t')
for row in spamreader:
b.insert( ) <-- how should the insert be done?
b.send()
And more in general how can I cast a string to DateType?
Regards Hans-Peter
Dit bericht is vertrouwelijk en kan geheime informatie bevatten enkel bestemd
voor de geadresseerde. Indien dit bericht niet voor u is bestemd, verzoeken wij
u dit onmiddellijk aan ons te melden en het bericht te vernietigen. Aangezien
de integriteit van het bericht niet veilig gesteld is middels verzending via
internet, kan Atos Nederland B.V. niet aansprakelijk worden gehouden voor de
inhoud daarvan. Hoewel wij ons inspannen een virusvrij netwerk te hanteren,
geven wij geen enkele garantie dat dit bericht virusvrij is, noch aanvaarden
wij enige aansprakelijkheid voor de mogelijke aanwezigheid van een virus in dit
bericht. Op al onze rechtsverhoudingen, aanbiedingen en overeenkomsten
waaronder Atos Nederland B.V. goederen en/of diensten levert zijn met
uitsluiting van alle andere voorwaarden de Leveringsvoorwaarden van Atos
Nederland B.V. van toepassing. Deze worden u op aanvraag direct kosteloos
toegezonden.
This e-mail and the documents attached are confidential and intended solely for
the addressee; it may also be privileged. If you receive this e-mail in error,
please notify the sender immediately and destroy it. As its integrity cannot be
secured on the Internet, the Atos Nederland B.V. group liability cannot be
triggered for the message content. Although the sender endeavours to maintain a
computer virus-free network, the sender does not warrant that this transmission
is virus-free and will not be liable for any damages resulting from any virus
transmitted. On all offers and agreements under which Atos Nederland B.V.
supplies goods and/or services of whatever nature, the Terms of Delivery from
Atos Nederland B.V. exclusively apply. The Terms of Delivery shall be promptly
submitted to you on your request.
Atos Nederland B.V. / Utrecht
KvK Utrecht 30132762