Search in sources :

Example 1 with MycatInsertRel

use of io.mycat.calcite.physical.MycatInsertRel in project Mycat2 by MyCATApache.

the class DrdsSqlCompiler method dispatch.

public MycatRel dispatch(OptimizationContext optimizationContext, DrdsSql drdsSql, SchemaPlus plus) {
    SQLStatement sqlStatement = drdsSql.getParameterizedStatement();
    if (sqlStatement instanceof SQLSelectStatement) {
        return compileQuery(optimizationContext, plus, drdsSql);
    }
    MetadataManager metadataManager = MetaClusterCurrent.wrapper(MetadataManager.class);
    if (sqlStatement instanceof MySqlInsertStatement) {
        MySqlInsertStatement insertStatement = (MySqlInsertStatement) sqlStatement;
        String schemaName = SQLUtils.normalize(insertStatement.getTableSource().getSchema());
        String tableName = SQLUtils.normalize(insertStatement.getTableName().getSimpleName());
        TableHandler logicTable = Objects.requireNonNull(metadataManager.getTable(schemaName, tableName));
        switch(logicTable.getType()) {
            case SHARDING:
                MycatInsertRel mycatInsertRel = new MycatInsertRel(sqlStatement, false);
                optimizationContext.saveAlways();
                return mycatInsertRel;
            case GLOBAL:
                return complieGlobalUpdate(optimizationContext, drdsSql, sqlStatement, (GlobalTable) logicTable);
            case NORMAL:
                return complieNormalUpdate(optimizationContext, drdsSql, sqlStatement, (NormalTable) logicTable);
            case CUSTOM:
                throw new UnsupportedOperationException();
        }
    } else if (sqlStatement instanceof MySqlUpdateStatement) {
        SQLExprTableSource tableSource = (SQLExprTableSource) ((MySqlUpdateStatement) sqlStatement).getTableSource();
        String schemaName = SQLUtils.normalize(tableSource.getSchema());
        String tableName = SQLUtils.normalize(((MySqlUpdateStatement) sqlStatement).getTableName().getSimpleName());
        TableHandler logicTable = metadataManager.getTable(schemaName, tableName);
        switch(logicTable.getType()) {
            case SHARDING:
                return compileUpdate(logicTable, optimizationContext, drdsSql, plus);
            case GLOBAL:
                {
                    return complieGlobalUpdate(optimizationContext, drdsSql, sqlStatement, (GlobalTable) logicTable);
                }
            case NORMAL:
                {
                    return complieNormalUpdate(optimizationContext, drdsSql, sqlStatement, (NormalTable) logicTable);
                }
            case CUSTOM:
                throw new UnsupportedOperationException();
        }
    } else if (sqlStatement instanceof SQLReplaceStatement) {
        SQLExprTableSource tableSource = (SQLExprTableSource) ((SQLReplaceStatement) sqlStatement).getTableSource();
        String schemaName = SQLUtils.normalize(Optional.ofNullable(tableSource).map(i -> i.getSchema()).orElse(null));
        String tableName = SQLUtils.normalize(((SQLReplaceStatement) sqlStatement).getTableName().getSimpleName());
        TableHandler logicTable = metadataManager.getTable(schemaName, tableName);
        switch(logicTable.getType()) {
            case SHARDING:
                return compileUpdate(logicTable, optimizationContext, drdsSql, plus);
            case GLOBAL:
                {
                    return complieGlobalUpdate(optimizationContext, drdsSql, sqlStatement, (GlobalTable) logicTable);
                }
            case NORMAL:
                {
                    return complieNormalUpdate(optimizationContext, drdsSql, sqlStatement, (NormalTable) logicTable);
                }
            case CUSTOM:
                throw new UnsupportedOperationException();
        }
    } else if (sqlStatement instanceof MySqlDeleteStatement) {
        SQLExprTableSource tableSource = (SQLExprTableSource) ((MySqlDeleteStatement) sqlStatement).getTableSource();
        String schemaName = SQLUtils.normalize(Optional.ofNullable(tableSource).map(i -> i.getSchema()).orElse(null));
        String tableName = SQLUtils.normalize(((MySqlDeleteStatement) sqlStatement).getTableName().getSimpleName());
        TableHandler logicTable = metadataManager.getTable(schemaName, tableName);
        switch(logicTable.getType()) {
            case SHARDING:
                return compileDelete(logicTable, optimizationContext, drdsSql, plus);
            case GLOBAL:
                {
                    return complieGlobalUpdate(optimizationContext, drdsSql, sqlStatement, (GlobalTable) logicTable);
                }
            case NORMAL:
                {
                    return complieNormalUpdate(optimizationContext, drdsSql, sqlStatement, (NormalTable) logicTable);
                }
            case CUSTOM:
                throw new UnsupportedOperationException();
        }
    }
    return null;
}
Also used : Programs(org.apache.calcite.tools.Programs) SneakyThrows(lombok.SneakyThrows) RelShuttleImpl(org.apache.calcite.rel.RelShuttleImpl) LoggerFactory(org.slf4j.LoggerFactory) MycatHepJoinClustering(org.apache.calcite.rel.rules.MycatHepJoinClustering) HBTParser(io.mycat.hbt.parser.HBTParser) SqlNode(org.apache.calcite.sql.SqlNode) RelBuilder(org.apache.calcite.tools.RelBuilder) HepProgram(org.apache.calcite.plan.hep.HepProgram) SqlValidator(org.apache.calcite.sql.validate.SqlValidator) HepMatchOrder(org.apache.calcite.plan.hep.HepMatchOrder) PlanImpl(io.mycat.calcite.spm.PlanImpl) Program(org.apache.calcite.tools.Program) ImmutableSet(com.google.common.collect.ImmutableSet) CalciteSchema(org.apache.calcite.jdbc.CalciteSchema) ImmutableMap(com.google.common.collect.ImmutableMap) MycatAggDistinctRule(io.mycat.calcite.rewriter.MycatAggDistinctRule) io.mycat.calcite.rules(io.mycat.calcite.rules) Table(org.apache.calcite.schema.Table) MycatUpdateRel(io.mycat.calcite.physical.MycatUpdateRel) ParseNode(io.mycat.hbt.parser.ParseNode) MultiJoin(org.apache.calcite.rel.rules.MultiJoin) Schema(io.mycat.hbt.ast.base.Schema) MySqlDeleteStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlDeleteStatement) LocalRules(io.mycat.calcite.localrel.LocalRules) VolcanoPlanner(org.apache.calcite.plan.volcano.VolcanoPlanner) NotNull(org.jetbrains.annotations.NotNull) java.util(java.util) Getter(lombok.Getter) DefaultRelMetadataProvider(org.apache.calcite.rel.metadata.DefaultRelMetadataProvider) RelRoot(org.apache.calcite.rel.RelRoot) DrdsExecutorCompiler.getCodeExecuterContext(io.mycat.DrdsExecutorCompiler.getCodeExecuterContext) HBTQueryConvertor(io.mycat.hbt.HBTQueryConvertor) SQLReplaceStatement(com.alibaba.druid.sql.ast.statement.SQLReplaceStatement) SqlToRelConverter(org.apache.calcite.sql2rel.SqlToRelConverter) MySqlInsertStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlInsertStatement) ImmutableList(com.google.common.collect.ImmutableList) org.apache.calcite.rel.type(org.apache.calcite.rel.type) HintStrategyTable(org.apache.calcite.rel.hint.HintStrategyTable) RelDecorrelator(org.apache.calcite.sql2rel.RelDecorrelator) MySqlUpdateStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlUpdateStatement) MycatTopN(io.mycat.calcite.physical.MycatTopN) OptimizationContext(io.mycat.calcite.rewriter.OptimizationContext) io.mycat.calcite.table(io.mycat.calcite.table) org.apache.calcite.rel.core(org.apache.calcite.rel.core) SQLUtils(com.alibaba.druid.sql.SQLUtils) SchemaPlus(org.apache.calcite.schema.SchemaPlus) Logger(org.slf4j.Logger) RelCollationTraitDef(org.apache.calcite.rel.RelCollationTraitDef) io.mycat.calcite(io.mycat.calcite) CalciteCatalogReader(org.apache.calcite.prepare.CalciteCatalogReader) MatierialRewriter(io.mycat.calcite.rewriter.MatierialRewriter) MycatProject(io.mycat.calcite.physical.MycatProject) SchemaConvertor(io.mycat.hbt.SchemaConvertor) HepPlanner(org.apache.calcite.plan.hep.HepPlanner) HepProgramBuilder(org.apache.calcite.plan.hep.HepProgramBuilder) RelNode(org.apache.calcite.rel.RelNode) AggregateExpandDistinctAggregatesRule(org.apache.calcite.rel.rules.AggregateExpandDistinctAggregatesRule) SqlDialect(org.apache.calcite.sql.SqlDialect) MycatViewIndexViewRule(io.mycat.calcite.logical.MycatViewIndexViewRule) SQLRBORewriter(io.mycat.calcite.rewriter.SQLRBORewriter) MycatInsertRel(io.mycat.calcite.physical.MycatInsertRel) CoreRules(org.apache.calcite.rel.rules.CoreRules) NameMap(io.mycat.util.NameMap) SQLStatement(com.alibaba.druid.sql.ast.SQLStatement) SQLSelectStatement(com.alibaba.druid.sql.ast.statement.SQLSelectStatement) RelMetadataProvider(org.apache.calcite.rel.metadata.RelMetadataProvider) SQLExprTableSource(com.alibaba.druid.sql.ast.statement.SQLExprTableSource) org.apache.calcite.plan(org.apache.calcite.plan) Plan(io.mycat.calcite.spm.Plan) MySqlInsertStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlInsertStatement) SQLStatement(com.alibaba.druid.sql.ast.SQLStatement) MySqlUpdateStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlUpdateStatement) MySqlDeleteStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlDeleteStatement) SQLSelectStatement(com.alibaba.druid.sql.ast.statement.SQLSelectStatement) SQLReplaceStatement(com.alibaba.druid.sql.ast.statement.SQLReplaceStatement) SQLExprTableSource(com.alibaba.druid.sql.ast.statement.SQLExprTableSource) MycatInsertRel(io.mycat.calcite.physical.MycatInsertRel)

Example 2 with MycatInsertRel

use of io.mycat.calcite.physical.MycatInsertRel in project Mycat2 by MyCATApache.

the class ObservablePlanImplementorImpl method executeInsert.

@Override
public Future<Void> executeInsert(Plan logical) {
    MycatInsertRel mycatRel = (MycatInsertRel) logical.getMycatRel();
    List<VertxExecuter.EachSQL> insertSqls = VertxExecuter.explainInsert((SQLInsertStatement) mycatRel.getSqlStatement(), drdsSqlWithParams.getParams());
    assert !insertSqls.isEmpty();
    Future<long[]> future;
    if (insertSqls.size() > 1) {
        future = VertxExecuter.simpleUpdate(context, true, true, mycatRel.isGlobal(), VertxExecuter.rewriteInsertBatchedStatements(insertSqls));
    } else {
        future = VertxExecuter.simpleUpdate(context, true, false, mycatRel.isGlobal(), insertSqls);
    }
    return future.eventually(u -> context.getTransactionSession().closeStatementState()).flatMap(result -> response.sendOk(result[0], result[1]));
}
Also used : VertxExecuter(io.mycat.vertx.VertxExecuter) Logger(org.slf4j.Logger) io.mycat(io.mycat) VertxUpdateExecuter(io.mycat.vertx.VertxUpdateExecuter) Collection(java.util.Collection) SQLInsertStatement(com.alibaba.druid.sql.ast.statement.SQLInsertStatement) ExecutorProvider(io.mycat.calcite.ExecutorProvider) LoggerFactory(org.slf4j.LoggerFactory) Future(io.vertx.core.Future) MycatUpdateRel(io.mycat.calcite.physical.MycatUpdateRel) ArrayBindable(org.apache.calcite.runtime.ArrayBindable) TimeUnit(java.util.concurrent.TimeUnit) MycatInsertRel(io.mycat.calcite.physical.MycatInsertRel) TimeRateLimiterService(io.mycat.ratelimiter.TimeRateLimiterService) List(java.util.List) PrepareExecutor(io.mycat.calcite.PrepareExecutor) MysqlPayloadObject(io.mycat.api.collector.MysqlPayloadObject) Observable(io.reactivex.rxjava3.core.Observable) XaSqlConnection(cn.mycat.vertx.xa.XaSqlConnection) Optional(java.util.Optional) Plan(io.mycat.calcite.spm.Plan) MycatInsertRel(io.mycat.calcite.physical.MycatInsertRel)

Example 3 with MycatInsertRel

use of io.mycat.calcite.physical.MycatInsertRel in project Mycat2 by MyCATApache.

the class HintHandler method loaddata.

@NotNull
private PromiseInternal<Void> loaddata(MycatDataContext dataContext, Response response, String body, MetadataManager metadataManager) throws IOException {
    Map<String, Object> map = JsonUtil.from(body, Map.class);
    String schemaName = Objects.requireNonNull((String) map.get("schemaName"));
    String tableName = Objects.requireNonNull((String) map.get("tableName"));
    final String fileName = Objects.toString(map.get("fileName"));
    CSVFormat format = CSVFormat.MYSQL;
    final Character delimiter = map.getOrDefault("delimiter", format.getDelimiter() + "").toString().charAt(0);
    final Character quoteChar = map.getOrDefault("quoteChar", format.getQuoteCharacter() + "").toString().charAt(0);
    final QuoteMode quoteMode = QuoteMode.valueOf(map.getOrDefault("quoteMode", format.getQuoteMode() + "").toString());
    final Character commentStart = Optional.ofNullable(map.get("commentStart")).map(c -> c.toString().charAt(0)).orElse(format.getCommentMarker());
    final Character escape = map.getOrDefault("escape", format.getEscapeCharacter()).toString().charAt(0);
    final Boolean ignoreSurroundingSpaces = Boolean.parseBoolean(map.getOrDefault("escape", format.getIgnoreSurroundingSpaces()).toString());
    final Boolean ignoreEmptyLines = Boolean.parseBoolean(map.getOrDefault("ignoreEmptyLines", format.getIgnoreEmptyLines()).toString());
    final String recordSeparator = map.getOrDefault("recordSeparator", format.getRecordSeparator()).toString();
    final String nullString = map.getOrDefault("nullString", format.getNullString()).toString();
    final List headerComments = (List) map.getOrDefault("headerComments", Arrays.asList(Optional.ofNullable(format.getHeaderComments()).orElse(new String[] {})));
    final List<String> header = Optional.ofNullable((List<String>) map.get("header")).orElse(null);
    final Boolean skipHeaderRecord = Boolean.parseBoolean(map.getOrDefault("skipHeaderRecord", format.getSkipHeaderRecord()).toString());
    final Boolean allowMissingColumnNames = Boolean.parseBoolean(map.getOrDefault("allowMissingColumnNames", format.getSkipHeaderRecord()).toString());
    final Boolean ignoreHeaderCase = Boolean.parseBoolean(map.getOrDefault("ignoreHeaderCase", format.getSkipHeaderRecord()).toString());
    final Boolean trim = Boolean.parseBoolean(map.getOrDefault("trim", format.getSkipHeaderRecord()).toString());
    final Boolean trailingDelimiter = Boolean.parseBoolean(map.getOrDefault("trailingDelimiter", format.getSkipHeaderRecord()).toString());
    final Boolean autoFlush = Boolean.parseBoolean(map.getOrDefault("autoFlush", format.getSkipHeaderRecord()).toString());
    final Boolean allowDuplicateHeaderNames = Boolean.parseBoolean(map.getOrDefault("allowDuplicateHeaderNames", format.getSkipHeaderRecord()).toString());
    format = CSVFormat.newFormat(delimiter).withQuote(quoteChar).withQuoteMode(quoteMode).withCommentMarker(commentStart).withEscape(escape).withIgnoreSurroundingSpaces(ignoreSurroundingSpaces).withIgnoreEmptyLines(ignoreEmptyLines).withRecordSeparator(recordSeparator).withNullString(nullString).withHeaderComments(headerComments).withHeader(Optional.ofNullable(header).map(n -> n.toArray(new String[] {})).orElse(null)).withSkipHeaderRecord(skipHeaderRecord).withAllowMissingColumnNames(allowMissingColumnNames).withIgnoreHeaderCase(ignoreHeaderCase).withTrim(trim).withTrailingDelimiter(trailingDelimiter).withAutoFlush(autoFlush).withAllowDuplicateHeaderNames(allowDuplicateHeaderNames);
    MySqlInsertStatement mySqlInsertStatement = new MySqlInsertStatement();
    mySqlInsertStatement.setTableName(new SQLIdentifierExpr(tableName));
    mySqlInsertStatement.getTableSource().setSchema(schemaName);
    List<String> columnNames;
    if (header == null || header.isEmpty()) {
        TableHandler table = Objects.requireNonNull(metadataManager.getTable(schemaName, tableName));
        columnNames = table.getColumns().stream().map(i -> (i.getColumnName())).collect(Collectors.toList());
    } else {
        columnNames = header;
    }
    for (SQLIdentifierExpr columnName : columnNames.stream().map(i -> new SQLIdentifierExpr("`" + i + "`")).collect(Collectors.toList())) {
        mySqlInsertStatement.addColumn(columnName);
    }
    int batch = 1000;
    Reader in = new FileReader(fileName);
    Iterable<CSVRecord> records = format.parse(in);
    Stream<SQLInsertStatement> insertStatementStream = StreamSupport.stream(records.spliterator(), false).map(strings -> {
        SQLInsertStatement sqlInsertStatement = mySqlInsertStatement.clone();
        SQLInsertStatement.ValuesClause valuesClause = new SQLInsertStatement.ValuesClause();
        for (String string : strings) {
            valuesClause.addValue(new SQLCharExpr(string));
        }
        sqlInsertStatement.addValueCause(valuesClause);
        return sqlInsertStatement;
    });
    UnmodifiableIterator<List<VertxExecuter.EachSQL>> iterator = Iterators.partition(insertStatementStream.flatMap(statement -> {
        DrdsSqlWithParams drdsSql = DrdsRunnerHelper.preParse(statement, dataContext.getDefaultSchema());
        Plan plan = UpdateSQLHandler.getPlan(drdsSql);
        MycatInsertRel mycatRel = (MycatInsertRel) plan.getMycatRel();
        Iterable<VertxExecuter.EachSQL> eachSQLS1 = VertxExecuter.explainInsert((SQLInsertStatement) mycatRel.getSqlStatement(), drdsSql.getParams());
        return StreamSupport.stream(eachSQLS1.spliterator(), false);
    }).iterator(), batch);
    Future<long[]> continution = Future.succeededFuture(new long[] { 0, 0 });
    while (iterator.hasNext()) {
        Iterable<VertxExecuter.EachSQL> eachSQL = VertxExecuter.rewriteInsertBatchedStatements(iterator.next());
        continution = continution.flatMap(o -> {
            Future<long[]> future = VertxExecuter.simpleUpdate(dataContext, true, true, false, eachSQL);
            return future.map(o2 -> new long[] { o[0] + o2[0], Math.max(o[1], o2[1]) });
        });
    }
    continution.onComplete(event -> JdbcUtils.close(in));
    return VertxUtil.castPromise(continution.flatMap(result -> {
        return response.sendOk(result[0], result[1]);
    }));
}
Also used : MycatdbCommand(io.mycat.commands.MycatdbCommand) io.mycat(io.mycat) CSVRecord(org.apache.commons.csv.CSVRecord) JdbcDataSource(io.mycat.datasource.jdbc.datasource.JdbcDataSource) CSVFormat(org.apache.commons.csv.CSVFormat) HeartbeatFlow(io.mycat.replica.heartbeat.HeartbeatFlow) Duration(java.time.Duration) MySQLErrorCode(io.mycat.beans.mysql.MySQLErrorCode) JsonUtil(io.mycat.util.JsonUtil) MySqlHintStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlHintStatement) io.mycat.config(io.mycat.config) Timestamp(java.sql.Timestamp) Reader(java.io.Reader) Future(io.vertx.core.Future) Collectors(java.util.stream.Collectors) ArrayBindable(org.apache.calcite.runtime.ArrayBindable) MycatSQLLogMonitor(io.mycat.monitor.MycatSQLLogMonitor) io.mycat.sqlhandler(io.mycat.sqlhandler) NormalTable(io.mycat.calcite.table.NormalTable) Nullable(org.jetbrains.annotations.Nullable) ReplicaSelector(io.mycat.replica.ReplicaSelector) UpdateSQLHandler(io.mycat.sqlhandler.dml.UpdateSQLHandler) Stream(java.util.stream.Stream) ReplicaSelectorManager(io.mycat.replica.ReplicaSelectorManager) DrdsRunnerHelper(io.mycat.calcite.DrdsRunnerHelper) PhysicsInstance(io.mycat.replica.PhysicsInstance) NotNull(org.jetbrains.annotations.NotNull) ShardingTable(io.mycat.calcite.table.ShardingTable) VertxExecuter(io.mycat.vertx.VertxExecuter) SqlEntry(io.mycat.monitor.SqlEntry) java.util(java.util) ResultSetBuilder(io.mycat.beans.mycat.ResultSetBuilder) SQLIdentifierExpr(com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr) LocalDateTime(java.time.LocalDateTime) XaLog(cn.mycat.vertx.xa.XaLog) Supplier(java.util.function.Supplier) Iterators(com.google.common.collect.Iterators) SqlResultSetService(io.mycat.commands.SqlResultSetService) InterruptThreadHint(io.mycat.hint.InterruptThreadHint) MycatSQLExprTableSourceUtil(io.mycat.util.MycatSQLExprTableSourceUtil) KillThreadHint(io.mycat.hint.KillThreadHint) Schedulers(io.reactivex.rxjava3.schedulers.Schedulers) JDBCType(java.sql.JDBCType) PrepareExecutor(io.mycat.calcite.PrepareExecutor) SchemaHandler(io.mycat.calcite.table.SchemaHandler) MySqlInsertStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlInsertStatement) ImmutableList(com.google.common.collect.ImmutableList) DatasourceStatus(io.mycat.replica.heartbeat.DatasourceStatus) Observable(io.reactivex.rxjava3.core.Observable) JdbcConnectionManager(io.mycat.datasource.jdbc.datasource.JdbcConnectionManager) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) RowBaseIterator(io.mycat.api.collector.RowBaseIterator) StreamSupport(java.util.stream.StreamSupport) GlobalTable(io.mycat.calcite.table.GlobalTable) SQLVariantRefExpr(com.alibaba.druid.sql.ast.expr.SQLVariantRefExpr) SQLUtils(com.alibaba.druid.sql.SQLUtils) Flowable(io.reactivex.rxjava3.core.Flowable) PromiseInternal(io.vertx.core.impl.future.PromiseInternal) io.mycat.hint(io.mycat.hint) VertxUpdateExecuter(io.mycat.vertx.VertxUpdateExecuter) StringWriter(java.io.StringWriter) SQLInsertStatement(com.alibaba.druid.sql.ast.statement.SQLInsertStatement) ExecutorProvider(io.mycat.calcite.ExecutorProvider) IOException(java.io.IOException) QuoteMode(org.apache.commons.csv.QuoteMode) SQLCommentHint(com.alibaba.druid.sql.ast.SQLCommentHint) SqlRecorderRuntime(io.mycat.exporter.SqlRecorderRuntime) VertxUtil(io.mycat.util.VertxUtil) ReplicaSwitchType(io.mycat.replica.ReplicaSwitchType) SQLCharExpr(com.alibaba.druid.sql.ast.expr.SQLCharExpr) MycatInsertRel(io.mycat.calcite.physical.MycatInsertRel) io.mycat.calcite.spm(io.mycat.calcite.spm) NameMap(io.mycat.util.NameMap) MysqlPayloadObject(io.mycat.api.collector.MysqlPayloadObject) JdbcUtils(com.alibaba.druid.util.JdbcUtils) CodeExecuterContext(io.mycat.calcite.CodeExecuterContext) HeartBeatStatus(io.mycat.replica.heartbeat.HeartBeatStatus) SQLStatement(com.alibaba.druid.sql.ast.SQLStatement) UnmodifiableIterator(com.google.common.collect.UnmodifiableIterator) FileReader(java.io.FileReader) SQLExprTableSource(com.alibaba.druid.sql.ast.statement.SQLExprTableSource) StorageManager(io.mycat.sqlhandler.config.StorageManager) Reader(java.io.Reader) FileReader(java.io.FileReader) QuoteMode(org.apache.commons.csv.QuoteMode) SQLInsertStatement(com.alibaba.druid.sql.ast.statement.SQLInsertStatement) ImmutableList(com.google.common.collect.ImmutableList) FileReader(java.io.FileReader) SQLCharExpr(com.alibaba.druid.sql.ast.expr.SQLCharExpr) SQLIdentifierExpr(com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr) VertxExecuter(io.mycat.vertx.VertxExecuter) MySqlInsertStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlInsertStatement) InterruptThreadHint(io.mycat.hint.InterruptThreadHint) KillThreadHint(io.mycat.hint.KillThreadHint) io.mycat.hint(io.mycat.hint) SQLCommentHint(com.alibaba.druid.sql.ast.SQLCommentHint) Future(io.vertx.core.Future) MysqlPayloadObject(io.mycat.api.collector.MysqlPayloadObject) CSVFormat(org.apache.commons.csv.CSVFormat) CSVRecord(org.apache.commons.csv.CSVRecord) MycatInsertRel(io.mycat.calcite.physical.MycatInsertRel) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

MycatInsertRel (io.mycat.calcite.physical.MycatInsertRel)3 SQLUtils (com.alibaba.druid.sql.SQLUtils)2 SQLStatement (com.alibaba.druid.sql.ast.SQLStatement)2 SQLExprTableSource (com.alibaba.druid.sql.ast.statement.SQLExprTableSource)2 SQLInsertStatement (com.alibaba.druid.sql.ast.statement.SQLInsertStatement)2 MySqlInsertStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlInsertStatement)2 ImmutableList (com.google.common.collect.ImmutableList)2 io.mycat (io.mycat)2 MysqlPayloadObject (io.mycat.api.collector.MysqlPayloadObject)2 ExecutorProvider (io.mycat.calcite.ExecutorProvider)2 PrepareExecutor (io.mycat.calcite.PrepareExecutor)2 MycatUpdateRel (io.mycat.calcite.physical.MycatUpdateRel)2 Plan (io.mycat.calcite.spm.Plan)2 NameMap (io.mycat.util.NameMap)2 VertxExecuter (io.mycat.vertx.VertxExecuter)2 VertxUpdateExecuter (io.mycat.vertx.VertxUpdateExecuter)2 Observable (io.reactivex.rxjava3.core.Observable)2 Future (io.vertx.core.Future)2 java.util (java.util)2 ArrayBindable (org.apache.calcite.runtime.ArrayBindable)2