[ 
https://issues.apache.org/jira/browse/DRILL-8005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17426740#comment-17426740
 ] 

ASF GitHub Bot commented on DRILL-8005:
---------------------------------------

cgivre commented on a change in pull request #2327:
URL: https://github.com/apache/drill/pull/2327#discussion_r725566154



##########
File path: 
contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/CapitalizingJdbcSchema.java
##########
@@ -93,6 +110,65 @@ void setHolder(SchemaPlus plusOfThis) {
     return inner.getTableNames();
   }
 
+
+  @Override
+  public CreateTableEntry createNewTable(String tableName, List<String> 
partitionColumns, StorageStrategy strategy) {
+    if (! plugin.getConfig().isWritable()) {
+      throw UserException
+        .dataWriteError()
+        .message(plugin.getName() + " is not writable.")
+        .build(logger);
+    }
+
+    return new CreateTableEntry() {
+
+      @Override
+      public Writer getWriter(PhysicalOperator child) throws IOException {
+        String tableWithSchema = 
JdbcQueryBuilder.buildCompleteTableName(tableName, catalog, schema);
+        return new JdbcWriter(child, tableWithSchema, inner, plugin);
+      }
+
+      @Override
+      public List<String> getPartitionColumns() {
+        return Collections.emptyList();
+      }
+    };
+  }
+
+  @Override
+  public void dropTable(String tableName) {
+    String tableWithSchema = 
JdbcQueryBuilder.buildCompleteTableName(tableName, catalog, schema);
+    String dropTableQuery = String.format("DROP TABLE %s", tableWithSchema);
+    dropTableQuery = JdbcDDLQueryUtils.cleanDDLQuery(dropTableQuery, 
plugin.getDialect());
+
+    try {
+      Connection conn = inner.getDataSource().getConnection();
+      Statement stmt = conn.createStatement();

Review comment:
       Fixed.  Here and elsewhere.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


> Add Writer to JDBC Storage Plugin
> ---------------------------------
>
>                 Key: DRILL-8005
>                 URL: https://issues.apache.org/jira/browse/DRILL-8005
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Storage - JDBC
>    Affects Versions: 1.19.0
>            Reporter: Charles Givre
>            Assignee: Charles Givre
>            Priority: Major
>             Fix For: 1.20.0
>
>
> Current implementation of Drill only allows writing to file systems.  This 
> issue proposes extending the JDBC plugin to allow writing to JDBC data 
> sources.  This will do so by implementing: 
> CREATE TABLE AS
> DROP TABLE
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to