You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by GitBox <gi...@apache.org> on 2019/05/12 03:31:01 UTC

[GitHub] [kylin] hit-lacus commented on a change in pull request #624: KYLIN-4001 Allow user-specified time format using real-time

hit-lacus commented on a change in pull request #624: KYLIN-4001 Allow user-specified time format using real-time
URL: https://github.com/apache/kylin/pull/624#discussion_r283117876
 
 

 ##########
 File path: stream-source-kafka/src/main/java/org/apache/kylin/stream/source/kafka/TimedJsonStreamParser.java
 ##########
 @@ -88,6 +91,21 @@ public TimedJsonStreamParser(List<TblColRef> cols, MessageParserInfo parserInfo)
                 }
                 logger.info("Using parser field mapping by {}", parserInfo.getColumnToSourceFieldMapping());
             }
+            this.tsParser = parserInfo.getTsParser();
+
+            if (!StringUtils.isEmpty(tsParser)) {
+                try {
+                    Class clazz = Class.forName(tsParser);
+                    Constructor constructor = clazz.getConstructor(MessageParserInfo.class);
+                    streamTimeParser = (AbstractTimeParser) constructor.newInstance(parserInfo);
+                } catch (Exception e) {
+                    throw new IllegalStateException("Invalid StreamingConfig, tsParser " + tsParser + ", tsPattern " + parserInfo.getTsPattern() + ".", e);
+                }
+            }else{
 
 Review comment:
   code not formated

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services