You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Philip Thompson (JIRA)" <ji...@apache.org> on 2015/10/09 20:03:05 UTC

[jira] [Updated] (CASSANDRA-10481) Quoted capitalised keyspace doesn't work as output for Hadoop

     [ https://issues.apache.org/jira/browse/CASSANDRA-10481?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Philip Thompson updated CASSANDRA-10481:
----------------------------------------
    Reproduced In: 2.1.8

> Quoted capitalised keyspace doesn't work as output for Hadoop
> -------------------------------------------------------------
>
>                 Key: CASSANDRA-10481
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10481
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Hadoop
>         Environment: Linux
>            Reporter: Joseph Allemandou
>            Assignee: Philip Thompson
>
> When using CqlOutputFormat with a quoted keyspace containing capital letters, the initialisation of the CqlRecordWriter fails.
> In the code,error is hapenning at metadata table creation in the core constructor:
> {code:title=CqlRecordWriter.java-main constructor|borderStyle=solid}
> CqlRecordWriter(Configuration conf) {
>          ...
>         try
>         {
>             String keyspace = ConfigHelper.getOutputKeyspace(conf);
>             try (Session client = CqlConfigHelper.getOutputCluster(ConfigHelper.getOutputInitialAddress(conf), conf).connect(keyspace))
>             {
>                 ringCache = new NativeRingCache(conf);
>                 if (client != null)
>                 {
>                     TableMetadata tableMetadata = client.getCluster().getMetadata().getKeyspace(client.getLoggedKeyspace()).getTable(ConfigHelper.getOutputColumnFamily(conf));
>                 ...    
>     }
> {code}
> It seemed to be dues to the reused function Metadata.handleId(keyspace) that, applied mulitple times, removes uoptes and finally lowercase the keyspace name.
> A valid solution (working for us at WMF) is to reuse the keyspace variable defined earlier instead of using the client one.
> {code:title=CqlRecordWriter.java-main constructor|borderStyle=solid}
> CqlRecordWriter(Configuration conf) {
>          ...
>         try
>         {
>             String keyspace = ConfigHelper.getOutputKeyspace(conf);
>             try (Session client = CqlConfigHelper.getOutputCluster(ConfigHelper.getOutputInitialAddress(conf), conf).connect(keyspace))
>             {
>                 ringCache = new NativeRingCache(conf);
>                 if (client != null)
>                 {
>                     TableMetadata tableMetadata = client.getCluster().getMetadata().getKeyspace(keyspace).getTable(ConfigHelper.getOutputColumnFamily(conf));
>                 ...    
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)