Skip to content

Commit

Permalink
Add RedshiftCompositeHandler class to populate environment from glue …
Browse files Browse the repository at this point in the history
…connections (#18)
  • Loading branch information
ejeffrli authored Sep 25, 2024
1 parent 41deb82 commit 2a0bb49
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*-
* #%L
* athena-redshift
* %%
* Copyright (C) 2019 - 2024 Amazon Web Services
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package com.amazonaws.athena.connectors.redshift;

import com.amazonaws.athena.connector.lambda.handlers.CompositeHandler;

public class RedshiftCompositeHandler extends CompositeHandler
{
public RedshiftCompositeHandler()
{
super(new RedshiftMetadataHandler(new RedshiftEnvironmentProperties().createEnvironment()), new RedshiftRecordHandler(new RedshiftEnvironmentProperties().createEnvironment()));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*-
* #%L
* athena-redshift
* %%
* Copyright (C) 2019 - 2024 Amazon Web Services
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package com.amazonaws.athena.connectors.redshift;

import com.amazonaws.athena.connectors.jdbc.JdbcEnvironmentProperties;

import java.util.Map;

public class RedshiftEnvironmentProperties extends JdbcEnvironmentProperties
{
@Override
protected String getConnectionStringPrefix(Map<String, String> connectionProperties)
{
return "redshift://jdbc:redshift://";
}
}

0 comments on commit 2a0bb49

Please sign in to comment.