Skip to content

Commit 7f47b51

Browse files
yiming187成
authored and
committed
KYLIN-2775 fix wrong tsColName parsing
1 parent 363f858 commit 7f47b51

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

examples/sample_cube/template/kafka/DEFAULT.KYLIN_STREAMING_TABLE.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"timeout": 60000,
77
"bufferSize": 65536,
88
"parserName": "org.apache.kylin.source.kafka.TimedJsonStreamParser",
9-
"parserProperties": "tsColName=order_time",
9+
"parserTimeStampField": "order_time",
1010
"last_modified": 0,
1111
"clusters": [
1212
{

source-kafka/src/main/java/org/apache/kylin/source/kafka/StreamingParser.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static StreamingParser getStreamingParser(String parserName, String parse
7676
Constructor constructor = clazz.getConstructor(List.class, Map.class);
7777
return (StreamingParser) constructor.newInstance(columns, properties);
7878
} else {
79-
throw new IllegalStateException("invalid StreamingConfig, parserName " + parserName + ", parserProperties " + parserProperties + ".");
79+
throw new IllegalStateException("Invalid StreamingConfig, parserName " + parserName + ", parserProperties " + parserProperties + ".");
8080
}
8181
}
8282

source-kafka/src/main/java/org/apache/kylin/source/kafka/config/KafkaConfig.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import com.fasterxml.jackson.annotation.JsonAutoDetect;
3535
import com.fasterxml.jackson.annotation.JsonManagedReference;
3636
import com.fasterxml.jackson.annotation.JsonProperty;
37+
import org.apache.kylin.source.kafka.TimedJsonStreamParser;
3738

3839
/**
3940
*/
@@ -141,12 +142,12 @@ public void setParserProperties(String parserProperties) {
141142

142143
public String getAllParserProperties() {
143144
StringBuilder sb = new StringBuilder();
144-
if (parserProperties != null)
145-
sb.append(parserProperties);
146145
if (parserTimeStampField != null) {
146+
sb.append(TimedJsonStreamParser.PROPERTY_TS_COLUMN_NAME + "=" + parserTimeStampField);
147147
sb.append(";");
148-
sb.append(parserTimeStampField);
149148
}
149+
if (parserProperties != null)
150+
sb.append(parserProperties);
150151
return sb.toString();
151152
}
152153

0 commit comments

Comments
 (0)