Skip to content

Commit f8d6923

Browse files
author
yanxi0227
committed
add default database
1 parent 9c817ec commit f8d6923

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

redis5/redis5-sink/src/main/java/com/dtstack/flink/sql/sink/redis/RedisOutputFormat.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ private void establishConnection() {
108108
if (timeout == 0){
109109
timeout = 10000;
110110
}
111+
if (database == null)
112+
{
113+
database = "0";
114+
}
111115

112116
switch (redisType){
113117
//单机
@@ -134,7 +138,7 @@ public void writeRecord(Tuple2 record) throws IOException {
134138
return;
135139
}
136140
Row row = tupleTrans.getField(1);
137-
if (record.getArity() != fieldNames.length) {
141+
if (row.getArity() != fieldNames.length) {
138142
return;
139143
}
140144

0 commit comments

Comments
 (0)