Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to include isntuser and also enable SS3 Encryp #1320

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions athena-cloudera-hive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@
<artifactId>athena-jdbc</artifactId>
<version>2022.47.1</version>
</dependency>
<dependency>
<groupId>Hive</groupId>
<artifactId>HiveJDBC42</artifactId>
<version>${clouderaVersion}</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>athena-jdbc</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* limitations under the License.
* #L%
*/
package com.amazonaws.athena.connectors.hortonworks;
package com.amazonaws.athena.connectors.cloudera;

import com.amazonaws.athena.connectors.jdbc.manager.JdbcFederationExpressionParser;
import com.google.common.base.Joiner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.amazonaws.athena.connector.lambda.domain.Split;
import com.amazonaws.athena.connector.lambda.domain.TableName;
import com.amazonaws.athena.connector.lambda.domain.predicate.Constraints;
import com.amazonaws.athena.connectors.hortonworks.ImpalaFederationExpressionParser;
import com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig;
import com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionInfo;
import com.amazonaws.athena.connectors.jdbc.connection.JdbcConnectionFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package com.amazonaws.athena.connectors.cloudera;

import com.amazonaws.athena.connector.lambda.domain.Split;
import com.amazonaws.athena.connectors.hortonworks.ImpalaFederationExpressionParser;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.amazonaws.athena.connector.lambda.domain.predicate.Range;
import com.amazonaws.athena.connector.lambda.domain.predicate.SortedRangeSet;
import com.amazonaws.athena.connector.lambda.domain.predicate.ValueSet;
import com.amazonaws.athena.connectors.hortonworks.ImpalaFederationExpressionParser;
import com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig;
import com.amazonaws.athena.connectors.jdbc.connection.JdbcConnectionFactory;
import com.amazonaws.athena.connectors.jdbc.connection.JdbcCredentialProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ protected SpillLocation write(Block block)
// only sees the InputStream wrapper.
ObjectMetadata objMeta = new ObjectMetadata();
objMeta.setContentLength(bytes.length);
objMeta.setSSEAlgorithm(ObjectMetadata.AES_256_SERVER_SIDE_ENCRYPTION);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary, just use this environment variable with this value:

spill_put_request_headers = {"x-amz-server-side-encryption" : "AES256"}

https://docs.aws.amazon.com/athena/latest/ug/connectors-cloudera-impala.html

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks that make sense

PutObjectRequest request = new PutObjectRequest(
spillLocation.getBucket(),
spillLocation.getKey(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ private Set<String> listDatabaseNames(final Connection jdbcConnection)
{
String queryToListUserCreatedSchemas = "select s.name as schema_name from " +
"sys.schemas s inner join sys.sysusers u on u.uid = s.principal_id " +
"where u.issqluser = 1 " +
"where (u.issqluser = 1 or u.isntuser =1 ) " +
"and u.name not in ('sys', 'guest', 'INFORMATION_SCHEMA') " +
"order by s.name";
try (Statement st = jdbcConnection.createStatement();
Expand Down