Thomas Heinemann created CALCITE-3907:
-----------------------------------------

             Summary: CassandraSchema ignores username and password if no port 
is specified
                 Key: CALCITE-3907
                 URL: https://issues.apache.org/jira/browse/CALCITE-3907
             Project: Calcite
          Issue Type: Bug
          Components: cassandra-adapter
         Environment: Manjaro Linux with a remote Cassandra
            Reporter: Thomas Heinemann


The constructor of CassandraSchema which takes username and password 
parameters, but not the port ignores the username and password when delegating 
to the main constructor. Hence, the main constructor tries to establish an 
unauthenticated connection
h2. Steps to reproduce:
 # Configure a model.json like the following:
{code:java}
{
  version: '1.0',
  defaultSchema: 'twissandra',
  schemas: [
    {
      name: 'twissandra',
      type: 'custom',
      factory: 'org.apache.calcite.adapter.cassandra.CassandraSchemaFactory',
      operand: {
        host: 'localhost',
        keyspace: 'twissandra'
        username: 'cassandra'
        password: 'cassandra'
      }
    }
  ]
}
{code}

 # Disable unauthenticated connections to the cassandra instance (but make sure 
username and password in the model.json are correct, and that Cassandra listens 
on the default port, i.e. 9042)
 # Use the model.json to connect to your Cassandra instance

h2. Expected behaviour

The connection is established using the username and password as given in the 
JSON
h2. Actual behaviour

The connection fails, because the connection was tried without using 
authentication



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to