You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/12/04 11:06:03 UTC
[GitHub] [flink] twalthr opened a new pull request #14309: [FLINK-20485][table] Improve performance of data views
twalthr opened a new pull request #14309:
URL: https://github.com/apache/flink/pull/14309
## What is the purpose of the change
This improves the performance when using map views in aggregate functions with retraction and distinct aggregates.
## Brief change log
- It reduces the deserialization overhead by using a lazy binary format.
- It reuses internal data structures during deserialization from bytes to external data structure (e.g. required for deduplicating map views using regular Java `Map`).
## Verifying this change
Manually benchmarked using the following test in `AggregateITCase` with LocalGlobal=ON, MiniBatch=ON, HEAP:
```
@Test
def testPerf(): Unit = {
tEnv.executeSql(
s"""
|CREATE TABLE datagen (a INT, b BIGINT, c STRING) WITH (
| 'connector'='datagen',
| 'rows-per-second'='500000',
| 'number-of-rows'='1000000',
| 'fields.a.kind' = 'random',
| 'fields.a.min' = '1',
| 'fields.a.max' = '10000',
| 'fields.b.min' = '1',
| 'fields.b.max' = '100000',
| 'fields.c.length' = '1000'
|)
|""".stripMargin)
val sqlQuery =
"SELECT b, " +
" SUM(DISTINCT (a * 3)), " +
" COUNT(DISTINCT SUBSTRING(c FROM 1 FOR 2))," +
" MAX(DISTINCT a), " +
" MIN(DISTINCT b), " +
" MAX(a), " +
" MIN(b), " +
" COUNT(DISTINCT c) " +
"FROM datagen " +
"GROUP BY b"
val result = tEnv.sqlQuery(sqlQuery).toRetractStream[Row]
result.addSink(new DiscardingSink[(Boolean, Row)])
env.execute()
}
```
The performance shows similar number that 1.11 or slightly better.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
- The serializers: yes
- The runtime per-record code paths (performance sensitive): yes
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? JavaDocs
----------------------------------------------------------------
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
[GitHub] [flink] twalthr commented on pull request #14309: [FLINK-20485][table] Improve performance of data views
Posted by GitBox <gi...@apache.org>.
twalthr commented on pull request #14309:
URL: https://github.com/apache/flink/pull/14309#issuecomment-739979840
Thanks for the review @wuchong. I removed some unused code in another commit.
Regarding 1: `DistinctViewSpec` is not really necessary but might help to improve code readability and gives this special `MapView` a name.
Regarding 2: The RAW type is an internal optimization and should not be exposed via API. A `MapView` is a structured type but with a special meaning. However, it can also be used in regular POJOs etc.
----------------------------------------------------------------
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
[GitHub] [flink] flinkbot edited a comment on pull request #14309: [FLINK-20485][table] Improve performance of data views
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14309:
URL: https://github.com/apache/flink/pull/14309#issuecomment-738733577
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2cc967f7c4d001bcd2c1960018893f49e34f65b5",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10523",
"triggerID" : "2cc967f7c4d001bcd2c1960018893f49e34f65b5",
"triggerType" : "PUSH"
}, {
"hash" : "918898dd2e8de0d3eee0e0ef0ab9ec906f3affb5",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "918898dd2e8de0d3eee0e0ef0ab9ec906f3affb5",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 2cc967f7c4d001bcd2c1960018893f49e34f65b5 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10523)
* 918898dd2e8de0d3eee0e0ef0ab9ec906f3affb5 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
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
[GitHub] [flink] twalthr closed pull request #14309: [FLINK-20485][table] Improve performance of data views
Posted by GitBox <gi...@apache.org>.
twalthr closed pull request #14309:
URL: https://github.com/apache/flink/pull/14309
----------------------------------------------------------------
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
[GitHub] [flink] flinkbot commented on pull request #14309: [FLINK-20485][table] Improve performance of data views
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #14309:
URL: https://github.com/apache/flink/pull/14309#issuecomment-738723328
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.
## Automated Checks
Last check on commit 2cc967f7c4d001bcd2c1960018893f49e34f65b5 (Fri Dec 04 11:08:11 UTC 2020)
**Warnings:**
* No documentation files were touched! Remember to keep the Flink docs up to date!
<sub>Mention the bot in a comment to re-run the automated checks.</sub>
## Review Progress
* ❓ 1. The [description] looks good.
* ❓ 2. There is [consensus] that the contribution should go into to Flink.
* ❓ 3. Needs [attention] from.
* ❓ 4. The change fits into the overall [architecture].
* ❓ 5. Overall code [quality] is good.
Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
- `@flinkbot approve all` to approve all aspects
- `@flinkbot approve-until architecture` to approve everything until `architecture`
- `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
- `@flinkbot disapprove architecture` to remove an approval you gave earlier
</details>
----------------------------------------------------------------
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
[GitHub] [flink] flinkbot edited a comment on pull request #14309: [FLINK-20485][table] Improve performance of data views
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14309:
URL: https://github.com/apache/flink/pull/14309#issuecomment-738733577
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2cc967f7c4d001bcd2c1960018893f49e34f65b5",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10523",
"triggerID" : "2cc967f7c4d001bcd2c1960018893f49e34f65b5",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 2cc967f7c4d001bcd2c1960018893f49e34f65b5 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10523)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
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
[GitHub] [flink] flinkbot edited a comment on pull request #14309: [FLINK-20485][table] Improve performance of data views
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14309:
URL: https://github.com/apache/flink/pull/14309#issuecomment-738733577
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2cc967f7c4d001bcd2c1960018893f49e34f65b5",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10523",
"triggerID" : "2cc967f7c4d001bcd2c1960018893f49e34f65b5",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 2cc967f7c4d001bcd2c1960018893f49e34f65b5 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10523)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
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
[GitHub] [flink] flinkbot edited a comment on pull request #14309: [FLINK-20485][table] Improve performance of data views
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14309:
URL: https://github.com/apache/flink/pull/14309#issuecomment-738733577
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2cc967f7c4d001bcd2c1960018893f49e34f65b5",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10523",
"triggerID" : "2cc967f7c4d001bcd2c1960018893f49e34f65b5",
"triggerType" : "PUSH"
}, {
"hash" : "918898dd2e8de0d3eee0e0ef0ab9ec906f3affb5",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10600",
"triggerID" : "918898dd2e8de0d3eee0e0ef0ab9ec906f3affb5",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 2cc967f7c4d001bcd2c1960018893f49e34f65b5 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10523)
* 918898dd2e8de0d3eee0e0ef0ab9ec906f3affb5 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10600)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
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
[GitHub] [flink] flinkbot edited a comment on pull request #14309: [FLINK-20485][table] Improve performance of data views
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14309:
URL: https://github.com/apache/flink/pull/14309#issuecomment-738733577
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2cc967f7c4d001bcd2c1960018893f49e34f65b5",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10523",
"triggerID" : "2cc967f7c4d001bcd2c1960018893f49e34f65b5",
"triggerType" : "PUSH"
}, {
"hash" : "918898dd2e8de0d3eee0e0ef0ab9ec906f3affb5",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10600",
"triggerID" : "918898dd2e8de0d3eee0e0ef0ab9ec906f3affb5",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 918898dd2e8de0d3eee0e0ef0ab9ec906f3affb5 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10600)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
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
[GitHub] [flink] flinkbot commented on pull request #14309: [FLINK-20485][table] Improve performance of data views
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #14309:
URL: https://github.com/apache/flink/pull/14309#issuecomment-738733577
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2cc967f7c4d001bcd2c1960018893f49e34f65b5",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "2cc967f7c4d001bcd2c1960018893f49e34f65b5",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 2cc967f7c4d001bcd2c1960018893f49e34f65b5 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
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
[GitHub] [flink] wuchong commented on pull request #14309: [FLINK-20485][table] Improve performance of data views
Posted by GitBox <gi...@apache.org>.
wuchong commented on pull request #14309:
URL: https://github.com/apache/flink/pull/14309#issuecomment-739735113
cc @JingsongLi , do you want to have a look?
----------------------------------------------------------------
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