Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3907

CassandraSchema ignores username and password if no port is specified

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cassandra-adapter
    • Environment:

      Manjaro Linux with a remote Cassandra

      Description

      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

      Steps to reproduce:

      1. Configure a model.json like the following:
        {
          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'
              }
            }
          ]
        }
        
      1. 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)
      2. Use the model.json to connect to your Cassandra instance

      Expected behaviour

      The connection is established using the username and password as given in the JSON

      Actual behaviour

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                theinemann Thomas Heinemann
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m