Skip to content

Commit

Permalink
fix FIMXE
Browse files Browse the repository at this point in the history
  • Loading branch information
kgyrtkirk committed Jul 25, 2024
1 parent d705c27 commit 8bb38a0
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private Signature makeSignature(AbstractDruidJdbcStatement druidStatement, List<
RelDataType rowType = RowSignatures.toRelDataType(sig, DruidTypeSystem.TYPE_FACTORY);
return Meta.Signature.create(
AbstractDruidJdbcStatement.createColumnMetaData(rowType),
"FIXME some query?",
druidStatement.getSqlQuery().sql(),
Collections.emptyList(),
Meta.CursorFactory.ARRAY,
Meta.StatementType.SELECT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ order by 1;
"finalize" : true,
"maxParseExceptions" : 0,
"plannerStrategy" : "DECOUPLED",
"sqlQueryId" : "86f85662-42c2-462f-8d1f-a692c33ebe99",
"sqlQueryId" : "959637f0-a795-41f2-9cf0-f12e29361401",
"sqlStringifyArrays" : false
}
}
Expand Down Expand Up @@ -127,8 +127,8 @@ order by 1;
"partitionCount" : 1,
"shuffle" : "globalSort",
"output" : "localStorage",
"startTime" : "2024-07-24T17:24:33.755Z",
"duration" : 657,
"startTime" : "2024-07-25T03:33:28.256Z",
"duration" : 754,
"sort" : true
}, {
"stageNumber" : 1,
Expand Down Expand Up @@ -200,7 +200,7 @@ order by 1;
"finalize" : true,
"maxParseExceptions" : 0,
"plannerStrategy" : "DECOUPLED",
"sqlQueryId" : "86f85662-42c2-462f-8d1f-a692c33ebe99",
"sqlQueryId" : "959637f0-a795-41f2-9cf0-f12e29361401",
"sqlStringifyArrays" : false
}
}
Expand All @@ -221,7 +221,7 @@ order by 1;
"workerCount" : 1,
"partitionCount" : 1,
"output" : "localStorage",
"startTime" : "2024-07-24T17:24:34.412Z",
"startTime" : "2024-07-25T03:33:29.010Z",
"duration" : 2
} ]
!msqPlan
Expand Down
7 changes: 7 additions & 0 deletions sql/src/main/java/org/apache/druid/sql/SqlQueryPlus.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ public SqlQueryPlus withParameters(List<TypedValue> parameters)
return new SqlQueryPlus(sql, queryContext, parameters, authResult);
}

@Override
public String toString()
{
return "SqlQueryPlus {queryContext=" + queryContext + ", parameters=" + parameters
+ ", authResult=" + authResult + ", sql=" + sql + " }";
}

public static class Builder
{
private String sql;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.calcite.rel.type.RelDataTypeField;
import org.apache.calcite.sql.type.SqlTypeName;
import org.apache.druid.java.util.common.ISE;
import org.apache.druid.sql.SqlQueryPlus;
import org.apache.druid.sql.avatica.DruidJdbcResultSet.ResultFetcherFactory;
import org.apache.druid.sql.calcite.planner.Calcites;
import org.apache.druid.sql.calcite.planner.PrepareResult;
Expand Down Expand Up @@ -59,6 +60,7 @@ public abstract class AbstractDruidJdbcStatement implements Closeable
protected final ResultFetcherFactory fetcherFactory;
protected Throwable throwable;
protected DruidJdbcResultSet resultSet;
protected SqlQueryPlus sqlQuery;

public AbstractDruidJdbcStatement(
final String connectionId,
Expand Down Expand Up @@ -246,4 +248,9 @@ public int getStatementId()
{
return statementId;
}

public SqlQueryPlus getSqlQuery()
{
return sqlQuery;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public DruidJdbcStatement(
public synchronized void execute(SqlQueryPlus queryPlus, long maxRowCount)
{
closeResultSet();
queryPlus = queryPlus.withContext(queryContext);
DirectStatement stmt = lifecycleFactory.directStatement(queryPlus);
this.sqlQuery = queryPlus.withContext(queryContext);
DirectStatement stmt = lifecycleFactory.directStatement(this.sqlQuery);
resultSet = new DruidJdbcResultSet(this, stmt, Long.MAX_VALUE, fetcherFactory);
try {
resultSet.execute();
Expand Down

0 comments on commit 8bb38a0

Please sign in to comment.