Skip to content

Commit

Permalink
refactor(action): adapt snowflake
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinplemelon authored and ysfscream committed Sep 10, 2024
1 parent 6fcb088 commit 9ecf37a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
Binary file added src/assets/img/snowflake.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/hooks/Rule/bridge/useBridgeTypeValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export const useBridgeTypeValue = (): {
{ value: BridgeType.AzureBlobStorage, label: 'Azure Blob Storage' },
{ value: BridgeType.Couchbase, label: 'Couchbase' },
{ value: BridgeType.Datalayers, label: 'Datalayers' },
{ value: BridgeType.Snowflake, label: 'Snowflake' },
].sort((a, b) => (bridgeOrderIndex[a.value] ?? 99) - (bridgeOrderIndex[b.value] ?? 99))

/**
Expand Down Expand Up @@ -329,6 +330,7 @@ export const useConnectorSchema = (): {
[BridgeType.Pulsar, getRef(BridgeType.Pulsar, '', 'post')],
[BridgeType.AzureBlobStorage, getRef(BridgeType.AzureBlobStorage, 'connector_')],
[BridgeType.Couchbase, getRef(BridgeType.Couchbase, 'connector_')],
[BridgeType.Snowflake, getRef(BridgeType.Snowflake, 'connector_')],
])

const typeWithMultipleRefKeyMap: Map<BridgeType, Array<string>> = new Map([
Expand Down Expand Up @@ -386,6 +388,7 @@ export const useActionSchema = (): {
[BridgeType.Pulsar, getRef(BridgeType.Pulsar, '')],
[BridgeType.AzureBlobStorage, getRef(BridgeType.AzureBlobStorage, 'action_')],
[BridgeType.Couchbase, getRef(BridgeType.Couchbase, 'action_')],
[BridgeType.Snowflake, getRef(BridgeType.Snowflake, 'action_')],
])
const getSchemaRefByType = (type: string) => {
const ref = specialActionTypeRefKeyMap.get(type)
Expand Down
27 changes: 27 additions & 0 deletions src/hooks/Rule/bridge/useSchemaBridgePropsLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ export default (
'buffer.memory_overload_protection',
])

const snowflakeAdvancedProps = getPathArrInParameters([
'pool_size',
'connect_timeout',
'pipelining',
'max_retries',
])

const kafkaProducerPropsOrderMap = {
...createOrderObj(
getPathArrInParameters([
Expand Down Expand Up @@ -290,6 +297,25 @@ export default (
],
fieldStartIndex,
),
[BridgeType.Snowflake]: createOrderObj(
[
...getPathArrInParameters([
'database',
'schema',
'stage',
'pipe',
'pipe_user',
'private_key',
]),
'container',
'type',
'column_order',
'max_records',
'time_interval',
...pulsarAdvancedProps,
],
fieldStartIndex,
),
}

const propsOrderMap = computed(() => {
Expand Down Expand Up @@ -339,6 +365,7 @@ export default (
[BridgeType.HStream]: HStreamAdvancedProps,
[BridgeType.Pulsar]: pulsarAdvancedProps,
[BridgeType.S3]: getPathArrInParameters(['headers', 'min_part_size', 'max_part_size']),
[BridgeType.Snowflake]: snowflakeAdvancedProps,
}

const advancedFields = computed(() => {
Expand Down
1 change: 1 addition & 0 deletions src/types/enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export enum BridgeType {
AzureBlobStorage = 'azure_blob_storage',
Couchbase = 'couchbase',
Datalayers = 'datalayers',
Snowflake = 'snowflake'
}

export enum PulsarType {
Expand Down

0 comments on commit 9ecf37a

Please sign in to comment.