Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7729A10E3F for ; Tue, 9 Jul 2013 14:41:10 +0000 (UTC) Received: (qmail 9621 invoked by uid 500); 9 Jul 2013 14:41:07 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 9600 invoked by uid 500); 9 Jul 2013 14:41:07 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 9592 invoked by uid 99); 9 Jul 2013 14:41:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jul 2013 14:41:07 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of olliflee@gmail.com designates 209.85.128.180 as permitted sender) Received: from [209.85.128.180] (HELO mail-ve0-f180.google.com) (209.85.128.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jul 2013 14:41:01 +0000 Received: by mail-ve0-f180.google.com with SMTP id pa12so4629634veb.25 for ; Tue, 09 Jul 2013 07:40:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=J8z7FFAekinYbqV34y+b9EV7M+lJCBcWX7z+f1xKN9g=; b=JrfXClUFcqp5T/PNkKtT1gopuwfIjOixe/Q8YdUs1HF21b4Wz186IBg3BOuI8a9cjo wY00vuh1MFMLNcBYbDn21seLZXiHByE0bmZWniLzAEHOEk4fbt72oEd7+02v8xE7gbFC AzrXHpGMANM2nLIxcnO9x02abyFX+0U7wOhBch6QtJCki1zQG3tWonneQ5pekDO7f7rP qsgCxmJI+BoABZuPi45NAhDCbFmamfRC+xD0HBkkRfa9R1ycxbsiprglCCAWldYcXI3k 0uzW9AA43So2XtNj3mlozDOeTd2alxXQLYGU4N3dmsdTOm1YDvc4DElux1qWAXEoiihY 4AXQ== MIME-Version: 1.0 X-Received: by 10.58.214.105 with SMTP id nz9mr16339921vec.58.1373380840264; Tue, 09 Jul 2013 07:40:40 -0700 (PDT) Received: by 10.52.117.112 with HTTP; Tue, 9 Jul 2013 07:40:40 -0700 (PDT) In-Reply-To: References: Date: Tue, 9 Jul 2013 22:40:40 +0800 Message-ID: Subject: Re: Purpose of BLOB datatype From: Ollif Lee To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=047d7bd6c64220188704e11525a9 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bd6c64220188704e11525a9 Content-Type: text/plain; charset=UTF-8 Thank you for your patience. That is what I have expected. PS. Do you know any direct ways in CQL to handle BLOB, just like DataStax Java driver? On Tue, Jul 9, 2013 at 4:53 PM, Sylvain Lebresne wrote: > > Pls explain why and how. > > Why and how what? > > Not encoding blobs into strings is the "preferred way" because that's > obviously > more efficient (in speed and space), since you don't do any encoding pass. > > As for how, "use prepared statement" was the "how". What are the exact > lines of > code to use to do prepared statements will depends on the client driver you > use, and you should check your driver documentation. > > But, to give you an example, if you use the DataStax Java driver > (https://github.com/datastax/java-driver), this might look something like: > > PreparedStatement st = session.prepare("INSERT INTO foo(myKey, myBlob) > VALUES (?, ?)"); > String myKey = ...; > ByteBuffer myBlob = ...; > session.execute(st.bind(myKey, myBlob)); > > > -- > Sylvain > --047d7bd6c64220188704e11525a9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thank you for your patience. That is what I have expected.=
PS. Do you know any direct ways in CQL to handle BLOB, just like= DataStax Java driver?
--047d7bd6c64220188704e11525a9--