Skip to content

Commit

Permalink
Merge pull request #1 from dremioJonny/master
Browse files Browse the repository at this point in the history
v12 upgrade
  • Loading branch information
dremio-brock authored Feb 2, 2021
2 parents 685ff34 + 67d3f9d commit 858eea8
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 10 deletions.
7 changes: 3 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
<modelVersion>4.0.0</modelVersion>

<groupId>com.dremio.plugin</groupId>
<version>3.2.4-201906051751050278-1bcce62</version>
<version>12.0.0</version>
<artifactId>dremio-dynamodb-plugin</artifactId>
<name>Dremio DynamoDB Community Connector</name>

<properties>
<version.dremio>3.2.4-201906051751050278-1bcce62</version.dremio>
<version.dremio>12.0.0-202012212145230282-d8947fd3</version.dremio>
</properties>

<dependencies>
Expand Down Expand Up @@ -67,7 +67,6 @@
<repository>
<id>dremio-free</id>
<url>http://maven.dremio.com/free/</url>
</repository>
</repository>
</repositories>
</project>

18 changes: 12 additions & 6 deletions src/main/java/com/dremio/exec/store/jdbc/conf/DynamodbConf.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
import com.dremio.exec.catalog.conf.DisplayMetadata;
import com.dremio.exec.catalog.conf.NotMetadataImpacting;
import com.dremio.exec.catalog.conf.SourceType;
import com.dremio.exec.server.SabotContext;
import com.dremio.options.OptionManager;
import com.dremio.security.CredentialsService;
import com.dremio.exec.store.jdbc.CloseableDataSource;
import com.dremio.exec.store.jdbc.DataSources;
import com.dremio.exec.store.jdbc.JdbcStoragePlugin;
import com.dremio.exec.store.jdbc.JdbcStoragePlugin.Config;
import com.dremio.exec.store.jdbc.JdbcPluginConfig;
import com.dremio.exec.store.jdbc.dialect.arp.ArpDialect;
import com.google.common.annotations.VisibleForTesting;

Expand All @@ -35,7 +35,7 @@
/**
* Configuration for SQLite sources.
*/
@SourceType(value = "DynamoDB", label = "DynamoDB")
@SourceType(value = "DynamoDB", label = "DynamoDB", uiConfig = "dynamoarp-layout.json")
public class DynamodbConf extends AbstractArpConf<DynamodbConf> {
private static final String ARP_FILENAME = "arp/implementation/dynamodb-arp.yaml";
private static final ArpDialect ARP_DIALECT =
Expand All @@ -62,6 +62,11 @@ public class DynamodbConf extends AbstractArpConf<DynamodbConf> {
@DisplayMetadata(label = "Region")
public String region;

@Tag(5)
@NotMetadataImpacting
@DisplayMetadata(label = "Grant External Query access (External Query allows creation of VDS from a Sybase query. Learn more here: https://docs.dremio.com/data-sources/external-queries.html#enabling-external-queries)")
public boolean enableExternalQuery = false;

//@NotBlank
//@Tag(5)
//@DisplayMetadata(label = "Local Metadata File")
Expand All @@ -86,12 +91,13 @@ public String toJdbcConnectionString() {

@Override
@VisibleForTesting
public Config toPluginConfig(SabotContext context) {
return JdbcStoragePlugin.Config.newBuilder()
public JdbcPluginConfig buildPluginConfig(JdbcPluginConfig.Builder configBuilder, CredentialsService credentialsService, OptionManager optionManager) {
return configBuilder.withDialect(getDialect())
.withDialect(getDialect())
.withDatasourceFactory(this::newDataSource)
.clearHiddenSchemas()
.addHiddenSchema("SYSTEM")
.withAllowExternalQuery(enableExternalQuery)
.build();
}

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/DynamoDB.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions src/main/resources/dynamoarp-layout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"sourceType": "DynamoDB",
"metadataRefresh": {
"datasetDiscovery": true
},
"form": {
"tabs": [
{
"name": "General",
"isGeneral": true,
"sections": [
{
"name": "Connection",
"layout": "row",
"elements": [
{
"propName": "config.host",
"placeholder": "e.g.123.123.123.123",
"size": "half",
"validate": {
"isRequired": true
}
},
{
"propName": "config.region",
"placeholder": "e.g. us-west-2",
"size": "half",
"validate": {
"isRequired": true
}
}
]
}
]
},
{
"name": "Advanced Options",
"sections": [
{
"elements": [
{
"propName": "config.enableExternalQuery"
}
]
}
]
}
]
}
}

0 comments on commit 858eea8

Please sign in to comment.