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

CassandraSchema ignores username and password if no port is specified

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            theinemann Thomas Heinemann
            Votes:
            0 Vote for this issue
            Watchers:
            3 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

                Slack

                  Issue deployment