Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 39412200B96 for ; Thu, 6 Oct 2016 14:21:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 37FE9160AE0; Thu, 6 Oct 2016 12:21:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 740B0160AAD for ; Thu, 6 Oct 2016 14:21:21 +0200 (CEST) Received: (qmail 93271 invoked by uid 500); 6 Oct 2016 12:21:20 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 93258 invoked by uid 99); 6 Oct 2016 12:21:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Oct 2016 12:21:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 715992C0088 for ; Thu, 6 Oct 2016 12:21:20 +0000 (UTC) Date: Thu, 6 Oct 2016 12:21:20 +0000 (UTC) From: "Alex Petrov (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (CASSANDRA-12606) CQLSSTableWriter unable to use blob conversion functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 06 Oct 2016 12:21:22 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-12606?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alex Petrov reassigned CASSANDRA-12606: --------------------------------------- Assignee: Alex Petrov > CQLSSTableWriter unable to use blob conversion functions > -------------------------------------------------------- > > Key: CASSANDRA-12606 > URL: https://issues.apache.org/jira/browse/CASSANDRA-12606 > Project: Cassandra > Issue Type: Bug > Components: CQL, Tools > Reporter: Mark Reddy > Assignee: Alex Petrov > Priority: Minor > > Attempting to use blob conversion functions e.g. textAsBlob, from 3.0 - 3.7 results in: > {noformat} > Exception in thread "main" org.apache.cassandra.exceptions.InvalidRequestException: Unknown function textasblob called > at org.apache.cassandra.cql3.functions.FunctionCall$Raw.prepare(FunctionCall.java:136) > at org.apache.cassandra.cql3.Operation$SetValue.prepare(Operation.java:163) > at org.apache.cassandra.cql3.statements.UpdateStatement$ParsedInsert.prepareInternal(UpdateStatement.java:173) > at org.apache.cassandra.cql3.statements.ModificationStatement$Parsed.prepare(ModificationStatement.java:785) > at org.apache.cassandra.cql3.statements.ModificationStatement$Parsed.prepare(ModificationStatement.java:771) > at org.apache.cassandra.io.sstable.CQLSSTableWriter$Builder.prepareInsert(CQLSSTableWriter.java:567) > at org.apache.cassandra.io.sstable.CQLSSTableWriter$Builder.build(CQLSSTableWriter.java:510) > {noformat} > The following snippet will reproduce the issue > {code} > String table = String.format("%s.%s", "test_ks", "test_table"); > String schema = String.format("CREATE TABLE %s (test_text text, test_blob blob, PRIMARY KEY(test_text));", table); > String insertStatement = String.format("INSERT INTO %s (test_text, test_blob) VALUES (?, textAsBlob(?))", table); > File tempDir = Files.createTempDirectory("tempDir").toFile(); > CQLSSTableWriter sstableWriter = CQLSSTableWriter.builder() > .forTable(schema) > .using(insertStatement) > .inDirectory(tempDir) > .build(); > {code} > This is caused in FunctionResolver.get(...) when candidates.addAll(Schema.instance.getFunctions(name.asNativeFunction())); is called, as there is no system keyspace initialised. -- This message was sent by Atlassian JIRA (v6.3.4#6332)