diff --git a/datavines-connector/datavines-connector-api/src/main/java/io/datavines/connector/api/DataSourceClient.java b/datavines-connector/datavines-connector-api/src/main/java/io/datavines/connector/api/DataSourceClient.java index e8659813f..1ede2d2ae 100644 --- a/datavines-connector/datavines-connector-api/src/main/java/io/datavines/connector/api/DataSourceClient.java +++ b/datavines-connector/datavines-connector-api/src/main/java/io/datavines/connector/api/DataSourceClient.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package io.datavines.connector.api; import io.datavines.common.datasource.jdbc.BaseJdbcDataSourceInfo; diff --git a/datavines-connector/datavines-connector-plugins/datavines-connector-jdbc/src/main/java/io/datavines/connector/plugin/JdbcDataSourceClient.java b/datavines-connector/datavines-connector-plugins/datavines-connector-jdbc/src/main/java/io/datavines/connector/plugin/JdbcDataSourceClient.java index 41f55e330..862bd8e35 100644 --- a/datavines-connector/datavines-connector-plugins/datavines-connector-jdbc/src/main/java/io/datavines/connector/plugin/JdbcDataSourceClient.java +++ b/datavines-connector/datavines-connector-plugins/datavines-connector-jdbc/src/main/java/io/datavines/connector/plugin/JdbcDataSourceClient.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package io.datavines.connector.plugin; import io.datavines.common.datasource.jdbc.BaseJdbcDataSourceInfo; diff --git a/datavines-connector/datavines-connector-plugins/datavines-connector-jdbc/src/main/java/io/datavines/connector/plugin/utils/JdbcUtils.java b/datavines-connector/datavines-connector-plugins/datavines-connector-jdbc/src/main/java/io/datavines/connector/plugin/utils/JdbcUtils.java index 9169ad980..fa7f88760 100644 --- a/datavines-connector/datavines-connector-plugins/datavines-connector-jdbc/src/main/java/io/datavines/connector/plugin/utils/JdbcUtils.java +++ b/datavines-connector/datavines-connector-plugins/datavines-connector-jdbc/src/main/java/io/datavines/connector/plugin/utils/JdbcUtils.java @@ -101,7 +101,7 @@ public static List getSchema(ResultSet resultSet, Dialect dialect, boolean isNullable = metaData.isNullable(i + 1) != ResultSetMetaData.columnNoNulls; StructField field = new StructField(); - field.setName(columnName); + field.setName(columnName.toLowerCase()); field.setDataType(typeConverter.convert(typeName)); field.setNullable(isNullable); field.setComment(""); diff --git a/datavines-engine/datavines-engine-executor/src/main/java/io/datavines/engine/executor/core/executor/BaseCommandProcess.java b/datavines-engine/datavines-engine-executor/src/main/java/io/datavines/engine/executor/core/executor/BaseCommandProcess.java index cc169ce0d..600e311ea 100644 --- a/datavines-engine/datavines-engine-executor/src/main/java/io/datavines/engine/executor/core/executor/BaseCommandProcess.java +++ b/datavines-engine/datavines-engine-executor/src/main/java/io/datavines/engine/executor/core/executor/BaseCommandProcess.java @@ -98,12 +98,19 @@ public ProcessResult run(String executeCommand){ String appId = YarnUtils.getYarnAppId(jobExecutionRequest.getTenantCode(), jobExecutionRequest.getJobExecutionUniqueId()); result.setApplicationId(appId); - - // if yarn job , yarn state is final state - if (exitValue == 0){ - exitStatusCode = YarnUtils.isSuccessOfYarnState(appId) ? ExecutionStatus.SUCCESS.getCode() : ExecutionStatus.FAILURE.getCode(); + if (StringUtils.isEmpty(appId)) { + if (exitValue == 0){ + exitStatusCode = ExecutionStatus.SUCCESS.getCode(); + } else { + exitStatusCode = ExecutionStatus.FAILURE.getCode(); + } } else { - exitStatusCode = ExecutionStatus.FAILURE.getCode(); + // if yarn job , yarn state is final state + if (exitValue == 0){ + exitStatusCode = YarnUtils.isSuccessOfYarnState(appId) ? ExecutionStatus.SUCCESS.getCode() : ExecutionStatus.FAILURE.getCode(); + } else { + exitStatusCode = ExecutionStatus.FAILURE.getCode(); + } } result.setExitStatusCode(exitStatusCode); diff --git a/datavines-engine/datavines-engine-plugins/datavines-engine-local/datavines-engine-local-connector-jdbc/src/main/java/io/datavines/engine/local/connector/executor/ErrorDataSinkExecutor.java b/datavines-engine/datavines-engine-plugins/datavines-engine-local/datavines-engine-local-connector-jdbc/src/main/java/io/datavines/engine/local/connector/executor/ErrorDataSinkExecutor.java index 0aeefcee9..967373364 100644 --- a/datavines-engine/datavines-engine-plugins/datavines-engine-local/datavines-engine-local-connector-jdbc/src/main/java/io/datavines/engine/local/connector/executor/ErrorDataSinkExecutor.java +++ b/datavines-engine/datavines-engine-plugins/datavines-engine-local/datavines-engine-local-connector-jdbc/src/main/java/io/datavines/engine/local/connector/executor/ErrorDataSinkExecutor.java @@ -178,9 +178,9 @@ private void sinkErrorData() { ResultList resultList = SqlUtils.getPageFromResultSet(errorDataResultSet, SqlUtils.getQueryFromsAndJoins("select * from " + sourceTable), start, end); for (Map row: resultList.getResultList()) { - for (int j=0 ;j