You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "morningman (via GitHub)" <gi...@apache.org> on 2023/06/13 14:21:32 UTC

[GitHub] [doris] morningman commented on a diff in pull request #20765: [improvement](jdbc) support insert autoinc and default value column to mysql

morningman commented on code in PR #20765:
URL: https://github.com/apache/doris/pull/20765#discussion_r1228208547


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/NativeInsertStmt.java:
##########
@@ -768,6 +774,13 @@ private DataSink createDataSink() throws AnalysisException {
                     table.getLineDelimiter(),
                     brokerDesc);
             dataPartition = dataSink.getOutputPartition();
+        } else if (targetTable instanceof JdbcTable) {

Review Comment:
   add comment



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/NativeInsertStmt.java:
##########
@@ -717,6 +721,8 @@ public void prepareExpressions() throws UserException {
             }
             if (exprByName.containsKey(col.getName())) {
                 resultExprByName.add(Pair.of(col.getName(), exprByName.get(col.getName())));
+            } else if (targetTable.getType().equals(TableIf.TableType.JDBC_EXTERNAL_TABLE)) {

Review Comment:
   Add comment



##########
fe/fe-core/src/main/java/org/apache/doris/external/jdbc/JdbcClient.java:
##########
@@ -387,13 +391,23 @@ protected ResultSet getColumns(DatabaseMetaData databaseMetaData, String catalog
         return databaseMetaData.getColumns(catalogName, schemaName, tableName, null);
     }
 
+    protected List<String> getPrimaryKeys(String dbName, String tableName) {
+        List<String> primaryKeys = Lists.newArrayList();
+        List<JdbcFieldSchema> columns = getJdbcColumnsInfo(dbName, tableName);

Review Comment:
   The logic in this method does not match the name of this method.
   Better change to a proper name, or add comment to explain why



##########
fe/fe-core/src/main/java/org/apache/doris/external/jdbc/JdbcClient.java:
##########
@@ -387,13 +391,23 @@ protected ResultSet getColumns(DatabaseMetaData databaseMetaData, String catalog
         return databaseMetaData.getColumns(catalogName, schemaName, tableName, null);
     }
 
+    protected List<String> getPrimaryKeys(String dbName, String tableName) {
+        List<String> primaryKeys = Lists.newArrayList();
+        List<JdbcFieldSchema> columns = getJdbcColumnsInfo(dbName, tableName);

Review Comment:
   Looks like all columns are primary key columns?



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org