Skip to content

Commit a1c7e97

Browse files
committed
Fix sql bug.
1 parent 6961ed9 commit a1c7e97

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

conf/dss-apps-server.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ wds.linkis.datasource.hikari.minimumIdle=10
1616
wds.dss.scriptis.global.limits.exportResEnable=false
1717
wds.dss.scriptis.global.limits.exportTableEnable=false
1818
wds.dss.scriptis.global.limits.downloadResEnable=true
19-
wds.dss.scriptis.global.limits.resCopyEnable=false
19+
wds.dss.scriptis.global.limits.resCopyEnable=true
2020
wds.dss.scriptis.global.limits.proxyEnable=false
2121

2222
#####user guide#####

dss-appconn/appconns/dss-datachecker-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/datachecker/connector/DataCheckerDao.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,15 @@ private PreparedStatement getJobStatement(Connection conn, String dataObject) th
247247
}
248248
partitionName = partitionName.replace("\'", "").replace("\"", "");
249249
tableName = tableName.split("\\{")[0];
250-
PreparedStatement pstmt = conn.prepareCall(SQL_SOURCE_TYPE_JOB_PARTITION);
250+
PreparedStatement pstmt = conn.prepareStatement(SQL_SOURCE_TYPE_JOB_PARTITION, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
251+
// PreparedStatement pstmt = conn.prepareCall(SQL_SOURCE_TYPE_JOB_PARTITION);
251252
pstmt.setString(1, dbName);
252253
pstmt.setString(2, tableName);
253254
pstmt.setString(3, partitionName);
254255
return pstmt;
255256
} else if (dataObjectArray.length == 2) {
256-
PreparedStatement pstmt = conn.prepareCall(SQL_SOURCE_TYPE_JOB_TABLE);
257+
PreparedStatement pstmt = conn.prepareStatement(SQL_SOURCE_TYPE_JOB_TABLE, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
258+
// PreparedStatement pstmt = conn.prepareCall(SQL_SOURCE_TYPE_JOB_TABLE);
257259
pstmt.setString(1, dbName);
258260
pstmt.setString(2, tableName);
259261
return pstmt;
@@ -278,9 +280,11 @@ private PreparedStatement getBdpStatement(Connection conn, String dataObject, St
278280
}
279281
PreparedStatement pstmt = null;
280282
if (timeScape.equals("NULL")) {
281-
pstmt = conn.prepareCall(SQL_SOURCE_TYPE_BDP);
283+
pstmt = conn.prepareStatement(SQL_SOURCE_TYPE_BDP, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
284+
// pstmt = conn.prepareCall(SQL_SOURCE_TYPE_BDP);
282285
} else {
283-
pstmt = conn.prepareCall(SQL_SOURCE_TYPE_BDP_WITH_TIME_CONDITION);
286+
pstmt = conn.prepareStatement(SQL_SOURCE_TYPE_BDP_WITH_TIME_CONDITION, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
287+
// pstmt = conn.prepareCall(SQL_SOURCE_TYPE_BDP_WITH_TIME_CONDITION);
284288
pstmt.setInt(4, Integer.valueOf(timeScape) * 3600);
285289
}
286290
pstmt.setString(1, dbName);

dss-appconn/appconns/dss-eventchecker-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/eventchecker/service/AbstractEventCheckReceiver.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ String getOffset(int jobId, Properties props, Logger log){
114114
String lastMsgId = "0";
115115
try {
116116
msgConn = getEventCheckerConnection(props,log);
117-
pstmtForGetID = msgConn.prepareCall(sqlForReadMsgID);
117+
pstmtForGetID = msgConn.prepareStatement(sqlForReadMsgID, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
118+
// pstmtForGetID = msgConn.prepareCall(sqlForReadMsgID);
118119
pstmtForGetID.setString(1, receiver);
119120
pstmtForGetID.setString(2, topic);
120121
pstmtForGetID.setString(3, msgName);
@@ -142,7 +143,8 @@ String[] getMsg(Properties props, Logger log,String ... params){
142143
String[] consumedMsgInfo = null;
143144
try {
144145
msgConn = getEventCheckerConnection(props,log);
145-
pstmt = msgConn.prepareCall(sqlForReadTMsg);
146+
pstmt = msgConn.prepareStatement(sqlForReadTMsg, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
147+
// pstmt = msgConn.prepareCall(sqlForReadTMsg);
146148
pstmt.setString(1, topic);
147149
pstmt.setString(2, msgName);
148150
pstmt.setString(3, params[0]);

dss-apps/dss-scriptis-server/src/main/java/com/webank/wedatasphere/dss/scriptis/pojo/entity/DssScriptDownloadAudit.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ public class DssScriptDownloadAudit {
1818
private String creator;
1919
private String tenant;
2020
private String path;
21-
@TableField("`sql`")
22-
@NotEmpty(message = "查询语句不能为空")
21+
@TableField("`sql`")
2322
private String sql;
2423

2524
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")

0 commit comments

Comments
 (0)