-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add col to partition-spec #731
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4ad5f38
feat: add col to partition-spec
nikhil-zlai 522beb3
Merge branch 'main' into nikhil/partition_spec_col
nikhil-zlai 4dcff32
test fix
nikhil-zlai d432705
Merge branch 'main' into nikhil/partition_spec_col
tchow-zlai 1391a4a
Merge branch 'main' into nikhil/partition_spec_col
nikhil-zlai ec7a4ad
Merge branch 'main' into nikhil/partition_spec_col
tchow-zlai 878aa24
Merge branch 'main' into nikhil/partition_spec_col
nikhil-zlai cba8494
date format in groupBy serving info
nikhil-zlai 0459533
reduce join test size
nikhil-zlai 8be784f
Merge branch 'main' into nikhil/partition_spec_col
nikhil-zlai 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -140,10 +140,13 @@ object GroupByUpload { | |
|
||
val groupBy = ai.chronon.spark.GroupBy | ||
.from(groupByConf, PartitionRange(endDs, endDs), TableUtils(session), computeDependency = false) | ||
|
||
groupByServingInfo.setBatchEndDate(nextDay) | ||
groupByServingInfo.setGroupBy(groupByConf) | ||
groupByServingInfo.setKeyAvroSchema(groupBy.keySchema.toAvroSchema("Key").toString(true)) | ||
groupByServingInfo.setSelectedAvroSchema(groupBy.preAggSchema.toAvroSchema("Value").toString(true)) | ||
groupByServingInfo.setDateFormat(tableUtils.partitionFormat) | ||
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. shouldn't this come from 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. its the same thing essentially |
||
|
||
if (groupByConf.streamingSource.isDefined) { | ||
val streamingSource = groupByConf.streamingSource.get | ||
|
||
|
@@ -181,7 +184,7 @@ object GroupByUpload { | |
logger.info("Not setting InputAvroSchema to GroupByServingInfo as there is no streaming source defined.") | ||
} | ||
|
||
val result = new GroupByServingInfoParsed(groupByServingInfo, tableUtils.partitionSpec) | ||
val result = new GroupByServingInfoParsed(groupByServingInfo) | ||
val firstSource = groupByConf.sources.get(0) | ||
logger.info(s""" | ||
|Built GroupByServingInfo for ${groupByConf.metaData.name}: | ||
|
@@ -259,6 +262,7 @@ object GroupByUpload { | |
)) | ||
val metaRdd = tableUtils.sparkSession.sparkContext.parallelize(metaRows.toSeq) | ||
val metaDf = tableUtils.sparkSession.createDataFrame(metaRdd, kvDf.schema) | ||
|
||
kvDf | ||
.union(metaDf) | ||
.withColumn("ds", lit(endDs)) | ||
|
@@ -270,9 +274,15 @@ object GroupByUpload { | |
|
||
val metricRow = | ||
kvDfReloaded.selectExpr("sum(bit_length(key_bytes))/8", "sum(bit_length(value_bytes))/8", "count(*)").collect() | ||
context.gauge(Metrics.Name.KeyBytes, metricRow(0).getDouble(0).toLong) | ||
context.gauge(Metrics.Name.ValueBytes, metricRow(0).getDouble(1).toLong) | ||
context.gauge(Metrics.Name.RowCount, metricRow(0).getLong(2)) | ||
|
||
if (metricRow.length > 0) { | ||
context.gauge(Metrics.Name.KeyBytes, metricRow(0).getDouble(0).toLong) | ||
context.gauge(Metrics.Name.ValueBytes, metricRow(0).getDouble(1).toLong) | ||
context.gauge(Metrics.Name.RowCount, metricRow(0).getLong(2)) | ||
} else { | ||
throw new RuntimeException("GroupBy upload resulted in zero rows.") | ||
} | ||
|
||
context.gauge(Metrics.Name.LatencyMinutes, (System.currentTimeMillis() - startTs) / (60 * 1000)) | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
unused