-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NU-1481] Table aggregation component (#5757)
added table api aggregation component and refactored flink source api
- Loading branch information
Showing
49 changed files
with
1,151 additions
and
418 deletions.
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
11 changes: 5 additions & 6 deletions
11
designer/server/src/test/resources/config/business-cases/tables-definition.sql
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 |
---|---|---|
@@ -1,23 +1,22 @@ | ||
CREATE TABLE transactions | ||
( | ||
datatime TIMESTAMP, | ||
datetime TIMESTAMP, | ||
client_id STRING, | ||
amount DECIMAL(15, 2), | ||
amount INT, | ||
`date` STRING | ||
) PARTITIONED BY (`date`) WITH ( | ||
'connector' = 'filesystem', | ||
'path' = 'file:///transactions', | ||
'format' = 'csv' | ||
); | ||
); | ||
|
||
CREATE TABLE transactions_summary | ||
( | ||
datatime TIMESTAMP, | ||
client_id STRING, | ||
amount DECIMAL(15, 2), | ||
amount INT, | ||
`date` STRING | ||
) PARTITIONED BY (`date`) WITH ( | ||
'connector' = 'filesystem', | ||
'path' = 'file:///output/transactions_summary', | ||
'format' = 'csv' | ||
) | ||
); |
4 changes: 2 additions & 2 deletions
4
designer/server/src/test/resources/transactions/date=2024-01-01/transaction-1.csv
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
"2024-01-01 10:00:00",client1,1.12 | ||
"2024-01-01 10:01:00",client2,2.21 | ||
"2024-01-01 10:00:00",client1,1 | ||
"2024-01-01 10:01:00",client2,2 | ||
"2024-01-01 10:02:00",client1,3 |
4 changes: 2 additions & 2 deletions
4
designer/server/src/test/resources/transactions/date=2024-01-02/transaction-1.csv
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
"2024-01-02 10:00:00",client1,1.12 | ||
"2024-01-02 10:01:00",client2,2.21 | ||
"2024-01-02 10:00:00",client1,1 | ||
"2024-01-02 10:01:00",client2,2 | ||
"2024-01-02 10:02:00",client1,3 |
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
26 changes: 26 additions & 0 deletions
26
...scala/pl/touk/nussknacker/engine/flink/api/process/FlinkContextInitializingFunction.scala
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package pl.touk.nussknacker.engine.flink.api.process | ||
|
||
import org.apache.flink.api.common.functions.{RichMapFunction, RuntimeContext} | ||
import org.apache.flink.configuration.Configuration | ||
import pl.touk.nussknacker.engine.api.Context | ||
import pl.touk.nussknacker.engine.api.process.{ContextInitializer, ContextInitializingFunction} | ||
import pl.touk.nussknacker.engine.api.runtimecontext.EngineRuntimeContext | ||
|
||
class FlinkContextInitializingFunction[Raw]( | ||
contextInitializer: ContextInitializer[Raw], | ||
nodeId: String, | ||
convertToEngineRuntimeContext: RuntimeContext => EngineRuntimeContext | ||
) extends RichMapFunction[Raw, Context] { | ||
|
||
private var initializingStrategy: ContextInitializingFunction[Raw] = _ | ||
|
||
override def open(parameters: Configuration): Unit = { | ||
val contextIdGenerator = convertToEngineRuntimeContext(getRuntimeContext).contextIdGenerator(nodeId) | ||
initializingStrategy = contextInitializer.initContext(contextIdGenerator) | ||
} | ||
|
||
override def map(input: Raw): Context = { | ||
initializingStrategy(input) | ||
} | ||
|
||
} |
Oops, something went wrong.