[ https://issues.apache.org/jira/browse/CASSANDRA-12606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16048662#comment-16048662 ]
Joel Knighton commented on CASSANDRA-12606: ------------------------------------------- Tests look good on the rebased branches, which I pushed for [trunk|https://github.com/jkni/cassandra/tree/ifesdjeen-12606-trunk], [3.11|https://github.com/jkni/cassandra/tree/ifesdjeen-12606-3.X], and [3.0|https://github.com/jkni/cassandra/tree/ifesdjeen-12606-3.0]. The 3.0/3.X rebases were trivial; trunk took a little bit of work because of the schema improvements made. I'm comfortable with you making the above changes on commit if you agree. I'm also happy to take a look at the changes before commit, if you want. +1. > 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.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org