Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KYLIN-4001 Allow user-specified time format using real-time #624

Merged
merged 2 commits into from
May 17, 2019

Conversation

GuoNingNing
Copy link

@GuoNingNing GuoNingNing commented Apr 29, 2019

Allow user-specified time format using real-time

I found that real-time only supports millisecond timestamp, does not support second timestamp and Date type like '2019-01-01 11:11:11'.
I add a LongTimeParser and a DateTimeParser and page configuration
You can configure tsParser, tsPattern on the page that creates the streaming table.

  • for date :
    { "timestamp":"2019-04-29 11:11:11","gmv":1.1 }
    tsParser=org.apache.kylin.stream.source.kafka.DateTimeParser
    tsPattern=yyyy-MM-dd HH:mm:ss

  • for second :
    { "timestamp":"1556618887","gmv":1.1 }
    tsParser=org.apache.kylin.stream.source.kafka.LongTimeParser
    tsPattern=S

  • for millisecond :
    { "timestamp":"1556618887000","gmv":1.1 }
    tsParser=org.apache.kylin.stream.source.kafka.LongTimeParser
    tsPattern=MS

@asfgit
Copy link

asfgit commented Apr 29, 2019

Can one of the admins verify this patch?

@GuoNingNing
Copy link
Author

I am really sorry, this is the first time I submitted the source code to the open source community. I skipped checkstyle, and now this version has been checked by checkstyle.xml.

@coveralls
Copy link

coveralls commented Apr 30, 2019

Pull Request Test Coverage Report for Build 4507

  • 20 of 49 (40.82%) changed or added relevant lines in 5 files are covered.
  • 4 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.0009%) to 28.16%

Changes Missing Coverage Covered Lines Changed/Added Lines %
stream-source-kafka/src/main/java/org/apache/kylin/stream/source/kafka/LongTimeParser.java 10 14 71.43%
stream-core/src/main/java/org/apache/kylin/stream/core/source/MessageParserInfo.java 0 6 0.0%
stream-source-kafka/src/main/java/org/apache/kylin/stream/source/kafka/TimedJsonStreamParser.java 8 14 57.14%
stream-source-kafka/src/main/java/org/apache/kylin/stream/source/kafka/DateTimeParser.java 0 13 0.0%
Files with Coverage Reduction New Missed Lines %
core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/MemDiskStore.java 1 78.12%
server-base/src/main/java/org/apache/kylin/rest/util/QueryRequestLimits.java 1 47.62%
core-cube/src/main/java/org/apache/kylin/cube/cuboid/TreeCuboidScheduler.java 2 68.46%
Totals Coverage Status
Change from base Build 4501: 0.0009%
Covered Lines: 23132
Relevant Lines: 82144

💛 - Coveralls

@codecov-io
Copy link

codecov-io commented Apr 30, 2019

Codecov Report

Merging #624 into master will decrease coverage by <.01%.
The diff coverage is 34.69%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #624      +/-   ##
============================================
- Coverage     25.67%   25.67%   -0.01%     
- Complexity     5957     5961       +4     
============================================
  Files          1379     1382       +3     
  Lines         82097    82144      +47     
  Branches      11507    11509       +2     
============================================
+ Hits          21081    21090       +9     
- Misses        58978    59012      +34     
- Partials       2038     2042       +4
Impacted Files Coverage Δ Complexity Δ
...ache/kylin/stream/source/kafka/DateTimeParser.java 0% <0%> (ø) 0 <0> (?)
...he/kylin/stream/core/source/MessageParserInfo.java 0% <0%> (ø) 0 <0> (ø) ⬇️
.../kylin/stream/source/kafka/AbstractTimeParser.java 100% <100%> (ø) 1 <1> (?)
...lin/stream/source/kafka/TimedJsonStreamParser.java 71.76% <50%> (-4.95%) 12 <0> (ø)
...ache/kylin/stream/source/kafka/LongTimeParser.java 57.14% <57.14%> (ø) 3 <3> (?)
...org/apache/kylin/rest/util/QueryRequestLimits.java 35.71% <0%> (-4.77%) 5% <0%> (-1%)
.../apache/kylin/cube/cuboid/TreeCuboidScheduler.java 63.84% <0%> (-2.31%) 0% <0%> (ø)
...rg/apache/kylin/cube/inmemcubing/MemDiskStore.java 70.21% <0%> (-0.92%) 7% <0%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ee95242...eadd90d. Read the comment docs.

@hit-lacus
Copy link
Member

hit-lacus commented May 10, 2019

Hi, could you please update your commit? @GuoNingNing

  1. Use correct git user name/ user email which can link to your github profile page
  2. Merge your commit into two commit, one for backend change, another for front end change
  3. Create a JIRA, describe :
    • the problem you found
    • how you solve it
    • how to use it
    • attach manual test screen shot
  4. Use KYLIN-XXXX in your git commit message

Thank you so much~

@GuoNingNing GuoNingNing changed the title Allow user-specified time format using real-time KYLIN-4001 Allow user-specified time format using real-time May 12, 2019
} catch (Exception e) {
throw new IllegalStateException("Invalid StreamingConfig, tsParser " + tsParser + ", tsPattern " + parserInfo.getTsPattern() + ".", e);
}
}else{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code not formated

Copy link

@allenma allenma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you merge this commit with the previous backend commit

@allenma
Copy link

allenma commented May 16, 2019

could you merge all commits into 2 commits?

@allenma allenma merged commit 876d420 into apache:master May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants