Skip to content

Commit a61f8f0

Browse files
committed
[not null][flinkStreamSQL支持not null 语法][17872]
1 parent 705e364 commit a61f8f0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core/src/main/java/com/dtstack/flink/sql/table/AbsSourceParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public abstract class AbsSourceParser extends AbsTableParser {
4242

4343
private static Pattern virtualFieldKeyPattern = Pattern.compile("(?i)^(\\S+\\([^\\)]+\\))\\s+AS\\s+(\\w+)$");
4444
private static Pattern waterMarkKeyPattern = Pattern.compile("(?i)^\\s*WATERMARK\\s+FOR\\s+(\\S+)\\s+AS\\s+withOffset\\(\\s*(\\S+)\\s*,\\s*(\\d+)\\s*\\)$");
45-
private static Pattern notNullKeyPattern = Pattern.compile("(?i)(\\w+)\\s+(\\w+)\\s+NOT\\s+NULL?$");
45+
private static Pattern notNullKeyPattern = Pattern.compile("(?i)^(\\w+)\\s+(\\w+)\\s+NOT\\s+NULL?$");
4646

4747
static {
4848
keyPatternMap.put(VIRTUAL_KEY, virtualFieldKeyPattern);

launcher/job/kafkaNotNull.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CREATE TABLE MyTable(
2-
channel varchar not null,
3-
pv INT,
2+
channel varchar as sss not null,
3+
pv INT not null,
44
xctime bigint,
55
CHARACTER_LENGTH(channel) as timeLeng,
66
WATERMARK FOR xctime AS withOffset(xctime,1000)

0 commit comments

Comments
 (0)