-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Ksql 386 ksql functions non static #370
Merged
hjafarpour
merged 14 commits into
confluentinc:4.0.x
from
hjafarpour:KSQL-386-KsqlFunctions-non-static
Oct 17, 2017
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0aca9a7
Bump to common 4.1.0-SNAPSHOT
2c82044
Merge remote-tracking branch 'origin/4.0.x'
ed1ee1e
Merge remote-tracking branch 'origin/4.0.x'
27a0e1f
Merge remote-tracking branch 'upstream/master'
hjafarpour 06b59a9
Better clean up for queries. Internal topics will be deletted after q…
hjafarpour 181fa50
Added singleton AdminClient back.
hjafarpour 8b299f3
Merge remote-tracking branch 'upstream/4.0.x' into KSQL-383-clean-up-…
hjafarpour bcec9eb
Fixed the pom version.
hjafarpour 93634bf
Pom version fix.
hjafarpour a4c863c
Refactored Function registry.
hjafarpour ac3b527
Applied review feedback.
hjafarpour e03d4d1
Merge remote-tracking branch 'upstream/4.0.x' into KSQL-386-KsqlFunct…
hjafarpour 984e51a
Minor modification in KSQLContext.
hjafarpour c9b3f75
Merge remote-tracking branch 'upstream/4.0.x' into KSQL-386-KsqlFunct…
hjafarpour File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,8 +126,9 @@ private PlanNode buildQueryLogicalPlan(final Query query, final MetaStore tempMe | |
|
||
AggregateAnalysis aggregateAnalysis = new AggregateAnalysis(); | ||
AggregateAnalyzer aggregateAnalyzer = new | ||
AggregateAnalyzer(aggregateAnalysis, analysis); | ||
AggregateExpressionRewriter aggregateExpressionRewriter = new AggregateExpressionRewriter(); | ||
AggregateAnalyzer(aggregateAnalysis, analysis, ksqlEngine.getFunctionRegistry()); | ||
AggregateExpressionRewriter aggregateExpressionRewriter = | ||
new AggregateExpressionRewriter(ksqlEngine.getFunctionRegistry()); | ||
for (Expression expression: analysis.getSelectExpressions()) { | ||
aggregateAnalyzer | ||
.process(expression, new AnalysisContext(null)); | ||
|
@@ -160,7 +161,7 @@ private PlanNode buildQueryLogicalPlan(final Query query, final MetaStore tempMe | |
|
||
|
||
// Build a logical plan | ||
PlanNode logicalPlan = new LogicalPlanner(analysis, aggregateAnalysis).buildPlan(); | ||
PlanNode logicalPlan = new LogicalPlanner(analysis, aggregateAnalysis, ksqlEngine.getFunctionRegistry()).buildPlan(); | ||
if (logicalPlan instanceof KsqlStructuredDataOutputNode) { | ||
KsqlStructuredDataOutputNode ksqlStructuredDataOutputNode = | ||
(KsqlStructuredDataOutputNode) logicalPlan; | ||
|
@@ -217,7 +218,9 @@ public void buildQueryPhysicalPlan(final List<QueryMetadata> physicalPlans, | |
KsqlConfig ksqlConfigClone = ksqlEngine.getKsqlConfig().clone(); | ||
|
||
// Build a physical plan, in this case a Kafka Streams DSL | ||
PhysicalPlanBuilder physicalPlanBuilder = new PhysicalPlanBuilder(builder, ksqlConfigClone, ksqlEngine.getTopicClient(), new MetastoreUtil()); | ||
PhysicalPlanBuilder physicalPlanBuilder = new PhysicalPlanBuilder(builder, ksqlConfigClone, | ||
ksqlEngine.getTopicClient(), | ||
new MetastoreUtil(), ksqlEngine.getFunctionRegistry()); | ||
SchemaKStream schemaKStream = physicalPlanBuilder.buildPhysicalPlan(logicalPlan); | ||
|
||
OutputNode outputNode = physicalPlanBuilder.getPlanSink(); | ||
|
@@ -291,7 +294,8 @@ private QueryMetadata buildPlanForBareQuery(boolean addUniqueTimeSuffix, | |
schemaKStream.getExecutionPlan(""), | ||
schemaKStream.getQueue(), | ||
(sourceSchemaKstream instanceof SchemaKTable) ? | ||
DataSource.DataSourceType.KTABLE : DataSource.DataSourceType.KSTREAM | ||
DataSource.DataSourceType.KTABLE : DataSource.DataSourceType.KSTREAM, | ||
applicationId | ||
); | ||
} | ||
|
||
|
@@ -308,9 +312,15 @@ private QueryMetadata buildPlanForBareQuery(boolean addUniqueTimeSuffix, | |
* @param persistanceQueryPrefix | ||
*/ | ||
private QueryMetadata buildPlanForStructuredOutputNode(boolean addUniqueTimeSuffix, | ||
Pair<String, PlanNode> statementPlanPair, Map<String, Object> overriddenStreamsProperties, | ||
boolean updateMetastore, StreamsBuilder builder, KsqlConfig ksqlConfigClone, SchemaKStream schemaKStream, | ||
KsqlStructuredDataOutputNode outputNode, String serviceId, String persistanceQueryPrefix) { | ||
Pair<String, PlanNode> statementPlanPair, | ||
Map<String, Object> overriddenStreamsProperties, | ||
boolean updateMetastore, | ||
StreamsBuilder builder, | ||
KsqlConfig ksqlConfigClone, | ||
SchemaKStream schemaKStream, | ||
KsqlStructuredDataOutputNode outputNode, | ||
String serviceId, | ||
String persistanceQueryPrefix) { | ||
|
||
long queryId = getNextQueryId(); | ||
|
||
|
@@ -353,7 +363,9 @@ private QueryMetadata buildPlanForStructuredOutputNode(boolean addUniqueTimeSuff | |
streams, outputNode, schemaKStream | ||
.getExecutionPlan(""), queryId, | ||
(schemaKStream instanceof SchemaKTable) ? DataSource | ||
.DataSourceType.KTABLE : DataSource.DataSourceType.KSTREAM); | ||
.DataSourceType.KTABLE : DataSource.DataSourceType | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto here |
||
.KSTREAM, | ||
applicationId); | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a
DataSourceType
toSchemaKStream
etc and then you can get rid of theinstanceOf
and callschemaKstream.dataSourceType()
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's discuss this a bit more.