From 0257dbcb80a3b33847bab46308fa313bc1fd9956 Mon Sep 17 00:00:00 2001 From: Meghana Y Date: Fri, 8 Oct 2021 13:58:46 +0530 Subject: [PATCH] Fix Lexer issue for Format type Protobuf --- src/main/antlr/ConnectorLexer.g4 | 2 +- src/test/java/com/datamountaineer/kcql/KcqlTest.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/antlr/ConnectorLexer.g4 b/src/main/antlr/ConnectorLexer.g4 index 7f3869e..29fb1fe 100644 --- a/src/main/antlr/ConnectorLexer.g4 +++ b/src/main/antlr/ConnectorLexer.g4 @@ -130,7 +130,7 @@ WITHUNWRAP ; FORMAT - : 'avro'|'AVRO'|'text'|'TEXT'|'binary'|'BINARY'|'json'|'JSON'|'object'|'OBJECT'|'map'|'MAP' + : 'avro'|'AVRO'|'text'|'TEXT'|'binary'|'BINARY'|'json'|'JSON'|'object'|'OBJECT'|'map'|'MAP'|'protobuf'|'PROTOBUF' ; PROJECTTO diff --git a/src/test/java/com/datamountaineer/kcql/KcqlTest.java b/src/test/java/com/datamountaineer/kcql/KcqlTest.java index d2e23ec..4b4a33d 100644 --- a/src/test/java/com/datamountaineer/kcql/KcqlTest.java +++ b/src/test/java/com/datamountaineer/kcql/KcqlTest.java @@ -801,6 +801,10 @@ public void handleStoredAs() { String syntax4 = String.format("INSERT INTO %s SELECT * FROM %s WITHFORMAT object", table, topic); Kcql c4 = Kcql.parse(syntax4); assertEquals(c4.getFormatType().toString(), "OBJECT"); + + String syntax5 = String.format("INSERT INTO %s SELECT * FROM %s WITHFORMAT protobuf", table, topic); + Kcql c5 = Kcql.parse(syntax5); + assertEquals(c5.getFormatType().toString(), "PROTOBUF"); } @Test(expected = IllegalArgumentException.class)