Skip to content

Commit

Permalink
Fix unit testing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
“v_kkhuang” committed Sep 29, 2024
1 parent 91e1400 commit bb78eb8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import org.apache.linkis.scheduler.executer.ErrorExecuteResponse;
import org.apache.linkis.scheduler.executer.ExecuteResponse;
import org.apache.linkis.storage.LineRecord;
import org.apache.linkis.storage.resultset.ResultSetFactory;
import org.apache.linkis.storage.resultset.ResultSetFactory$;
import org.apache.linkis.storage.resultset.table.TableMetaData;

import org.apache.commons.collections.MapUtils;
Expand Down Expand Up @@ -134,7 +134,7 @@ public ExecuteResponse executeLine(EngineExecutionContext engineExecutorContext,
(ElasticSearchTableResponse) elasticSearchResponse;
TableMetaData metaData = new TableMetaData(tableResponse.columns());
ResultSetWriter<? extends MetaData, ? extends Record> resultSetWriter =
engineExecutorContext.createResultSetWriter(ResultSetFactory.TABLE_TYPE());
engineExecutorContext.createResultSetWriter(ResultSetFactory$.MODULE$.TABLE_TYPE());
resultSetWriter.addMetaData(metaData);
Arrays.asList(tableResponse.records())
.forEach(
Expand All @@ -152,7 +152,7 @@ record -> {
} else if (elasticSearchResponse instanceof ElasticSearchJsonResponse) {
ElasticSearchJsonResponse jsonResponse = (ElasticSearchJsonResponse) elasticSearchResponse;
ResultSetWriter<? extends MetaData, ? extends Record> resultSetWriter =
engineExecutorContext.createResultSetWriter(ResultSetFactory.TEXT_TYPE());
engineExecutorContext.createResultSetWriter(ResultSetFactory$.MODULE$.TABLE_TYPE());
resultSetWriter.addMetaData(null);
Arrays.stream(jsonResponse.value().split("\\n"))
.forEach(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import org.apache.linkis.scheduler.executer.SuccessExecuteResponse;
import org.apache.linkis.storage.domain.Column;
import org.apache.linkis.storage.domain.DataType;
import org.apache.linkis.storage.resultset.ResultSetFactory;
import org.apache.linkis.storage.resultset.ResultSetFactory$;
import org.apache.linkis.storage.resultset.table.TableMetaData;
import org.apache.linkis.storage.resultset.table.TableRecord;

Expand Down Expand Up @@ -325,7 +325,7 @@ private void queryOutput(
int columnCount = 0;
int rows = 0;
ResultSetWriter resultSetWriter =
engineExecutorContext.createResultSetWriter(ResultSetFactory.TABLE_TYPE());
engineExecutorContext.createResultSetWriter(ResultSetFactory$.MODULE$.TABLE_TYPE());
try {
QueryStatusInfo results = null;
if (statement.isRunning()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,16 @@ wds.linkis.gateway.conf.publicservice.list=query,jobhistory,application,configur
#logging.file=./test.log
#debug=true

#h2 database config
spring.datasource.driver-class-name=org.h2.Driver
#init
spring.datasource.url=jdbc:h2:mem:test;MODE=MySQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=true
spring.datasource.schema=classpath:create.sql
spring.datasource.data=classpath:data.sql
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.hikari.connection-test-query=select 1
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.auto-commit=true
spring.datasource.hikari.validation-timeout=3000
spring.datasource.hikari.pool-name=linkis-test
spring.datasource.hikari.maximum-pool-size=50
spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.idle-timeout=600000
spring.datasource.hikari.leak-detection-threshold=0
spring.datasource.hikari.initialization-fail-timeout=1
spring.sql.init.schema-locations=classpath:create.sql
springfox.documentation.enabled=false
springfox.documentation.auto-startup=false
springfox.documentation.swagger-ui.enabled=false

spring.main.web-application-type=servlet
server.port=1234
Expand Down

0 comments on commit bb78eb8

Please sign in to comment.