-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: skip users and tracks tables with destConfig
- Loading branch information
Showing
12 changed files
with
82 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
const { processWarehouseMessage } = require('../../../warehouse'); | ||
|
||
const azureDatalake = 'azure_datalake'; | ||
|
||
function processSingleMessage(message, options) { | ||
return processWarehouseMessage(message, options); | ||
} | ||
const provider = 'azure_datalake'; | ||
|
||
function getDataTypeOverride() {} | ||
|
||
function process(event) { | ||
const whSchemaVersion = event.request.query.whSchemaVersion || 'v1'; | ||
const whStoreEvent = event.destination.Config.storeFullEvent === true; | ||
const provider = azureDatalake; | ||
return processSingleMessage(event.message, { | ||
return processWarehouseMessage(event.message, { | ||
metadata: event.metadata, | ||
whSchemaVersion, | ||
whStoreEvent, | ||
getDataTypeOverride, | ||
provider, | ||
sourceCategory: event.metadata ? event.metadata.sourceCategory : null, | ||
destConfig: event.destination?.Config, | ||
}); | ||
} | ||
|
||
exports.process = process; | ||
module.exports = { | ||
provider, | ||
process, | ||
}; |
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,28 +1,25 @@ | ||
const { processWarehouseMessage } = require('../../../warehouse'); | ||
|
||
const azureSynapse = 'azure_synapse'; | ||
|
||
function processSingleMessage(message, options) { | ||
return processWarehouseMessage(message, options); | ||
} | ||
const provider = 'azure_synapse'; | ||
|
||
function getDataTypeOverride() {} | ||
|
||
function process(event) { | ||
const whSchemaVersion = event.request.query.whSchemaVersion || 'v1'; | ||
const whStoreEvent = event.destination.Config.storeFullEvent === true; | ||
const provider = azureSynapse; | ||
return processSingleMessage(event.message, { | ||
return processWarehouseMessage(event.message, { | ||
metadata: event.metadata, | ||
whSchemaVersion, | ||
whStoreEvent, | ||
getDataTypeOverride, | ||
provider, | ||
sourceCategory: event.metadata ? event.metadata.sourceCategory : null, | ||
destConfig: event.destination?.Config, | ||
}); | ||
} | ||
|
||
module.exports = { | ||
provider, | ||
process, | ||
getDataTypeOverride, | ||
}; |
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 |
---|---|---|
@@ -1,64 +1,57 @@ | ||
const { processWarehouseMessage } = require('../../../warehouse'); | ||
const { getDataType } = require('../../../warehouse/index'); | ||
|
||
const clickhouse = 'clickhouse'; | ||
|
||
function processSingleMessage(message, options) { | ||
return processWarehouseMessage(message, options); | ||
} | ||
const provider = 'clickhouse'; | ||
|
||
function getDataTypeOverride(key, val, options) { | ||
if (options.chEnableArraySupport === 'false') { | ||
return 'string'; | ||
} | ||
if (Array.isArray(val)) { | ||
// for now returning it as string. confirm this case | ||
if (val.length === 0) { | ||
return 'string'; | ||
} | ||
// check for different data types in the array. if there are different then return array(string) | ||
const firstValueDataType = getDataType(key, val[0], {}); | ||
let finalDataType = firstValueDataType; | ||
for (let i = 1; i < val.length; i += 1) { | ||
const dataType = getDataType(key, val[i], {}); | ||
if (finalDataType !== dataType) { | ||
if (finalDataType === 'string') { | ||
break; | ||
} | ||
if (dataType === 'float' && finalDataType === 'int') { | ||
finalDataType = 'float'; | ||
// eslint-disable-next-line no-continue | ||
continue; | ||
} | ||
if (dataType === 'int' && finalDataType === 'float') { | ||
// eslint-disable-next-line no-continue | ||
continue; | ||
} | ||
finalDataType = 'string'; | ||
if (!Array.isArray(val) || val.length === 0) { | ||
return 'string'; | ||
} | ||
|
||
// check for different data types in the array. if there are different -> return array(string) | ||
let finalDataType = getDataType(key, val[0], {}); | ||
for (let i = 1; i < val.length; i += 1) { | ||
const dataType = getDataType(key, val[i], {}); | ||
if (finalDataType !== dataType) { | ||
if (finalDataType === 'string') { | ||
break; | ||
} | ||
if (dataType === 'float' && finalDataType === 'int') { | ||
finalDataType = 'float'; | ||
// eslint-disable-next-line no-continue | ||
continue; | ||
} | ||
if (dataType === 'int' && finalDataType === 'float') { | ||
// eslint-disable-next-line no-continue | ||
continue; | ||
} | ||
finalDataType = 'string'; | ||
} | ||
return `array(${finalDataType})`; | ||
} | ||
return 'string'; | ||
return `array(${finalDataType})`; | ||
} | ||
|
||
function process(event) { | ||
const whSchemaVersion = event.request.query.whSchemaVersion || 'v1'; | ||
const whStoreEvent = event.destination.Config.storeFullEvent === true; | ||
const provider = clickhouse; | ||
const chEnableArraySupport = event.request.query.chEnableArraySupport || 'false'; | ||
return processSingleMessage(event.message, { | ||
return processWarehouseMessage(event.message, { | ||
metadata: event.metadata, | ||
whSchemaVersion, | ||
whStoreEvent, | ||
getDataTypeOverride, | ||
provider, | ||
chEnableArraySupport, | ||
sourceCategory: event.metadata ? event.metadata.sourceCategory : null, | ||
destConfig: event.destination?.Config, | ||
}); | ||
} | ||
|
||
module.exports = { | ||
provider, | ||
process, | ||
getDataTypeOverride, | ||
}; |
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,25 +1,22 @@ | ||
const { processWarehouseMessage } = require('../../../warehouse'); | ||
|
||
const deltalake = 'deltalake'; | ||
|
||
function processSingleMessage(message, options) { | ||
return processWarehouseMessage(message, options); | ||
} | ||
|
||
function getDataTypeOverride() {} | ||
const provider = 'deltalake'; | ||
|
||
function process(event) { | ||
const whSchemaVersion = event.request.query.whSchemaVersion || 'v1'; | ||
const whStoreEvent = event.destination.Config.storeFullEvent === true; | ||
const provider = deltalake; | ||
return processSingleMessage(event.message, { | ||
return processWarehouseMessage(event.message, { | ||
metadata: event.metadata, | ||
whSchemaVersion, | ||
whStoreEvent, | ||
getDataTypeOverride, | ||
getDataTypeOverride: () => {}, | ||
provider, | ||
sourceCategory: event.metadata ? event.metadata.sourceCategory : null, | ||
destConfig: event.destination?.Config, | ||
}); | ||
} | ||
|
||
exports.process = process; | ||
module.exports = { | ||
provider, | ||
process, | ||
}; |
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,25 +1,22 @@ | ||
const { processWarehouseMessage } = require('../../../warehouse'); | ||
|
||
const gcsDatalake = 'gcs_datalake'; | ||
|
||
function processSingleMessage(message, options) { | ||
return processWarehouseMessage(message, options); | ||
} | ||
|
||
function getDataTypeOverride() {} | ||
const provider = 'gcs_datalake'; | ||
|
||
function process(event) { | ||
const whSchemaVersion = event.request.query.whSchemaVersion || 'v1'; | ||
const whStoreEvent = event.destination.Config.storeFullEvent === true; | ||
const provider = gcsDatalake; | ||
return processSingleMessage(event.message, { | ||
return processWarehouseMessage(event.message, { | ||
metadata: event.metadata, | ||
whSchemaVersion, | ||
whStoreEvent, | ||
getDataTypeOverride, | ||
getDataTypeOverride: () => {}, | ||
provider, | ||
sourceCategory: event.metadata ? event.metadata.sourceCategory : null, | ||
destConfig: event.destination?.Config, | ||
}); | ||
} | ||
|
||
exports.process = process; | ||
module.exports = { | ||
provider, | ||
process, | ||
}; |
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,28 +1,24 @@ | ||
const { processWarehouseMessage } = require('../../../warehouse'); | ||
|
||
const mssql = 'mssql'; | ||
|
||
function processSingleMessage(message, options) { | ||
return processWarehouseMessage(message, options); | ||
} | ||
|
||
const provider = 'mssql'; | ||
function getDataTypeOverride() {} | ||
|
||
function process(event) { | ||
const whSchemaVersion = event.request.query.whSchemaVersion || 'v1'; | ||
const whStoreEvent = event.destination.Config.storeFullEvent === true; | ||
const provider = mssql; | ||
return processSingleMessage(event.message, { | ||
return processWarehouseMessage(event.message, { | ||
metadata: event.metadata, | ||
whSchemaVersion, | ||
whStoreEvent, | ||
getDataTypeOverride, | ||
provider, | ||
sourceCategory: event.metadata ? event.metadata.sourceCategory : null, | ||
destConfig: event.destination?.Config, | ||
}); | ||
} | ||
|
||
module.exports = { | ||
provider, | ||
process, | ||
getDataTypeOverride, | ||
}; |
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 |
---|---|---|
@@ -1,29 +1,25 @@ | ||
const { processWarehouseMessage } = require('../../../warehouse'); | ||
|
||
// use postgres providers for s3-datalake | ||
const s3datalakeProvider = 's3_datalake'; | ||
|
||
function processSingleMessage(message, options) { | ||
return processWarehouseMessage(message, options); | ||
} | ||
|
||
const provider = 's3_datalake'; | ||
function getDataTypeOverride() {} | ||
|
||
function process(event) { | ||
const whSchemaVersion = event.request.query.whSchemaVersion || 'v1'; | ||
const whStoreEvent = event.destination.Config.storeFullEvent === true; | ||
const provider = s3datalakeProvider; | ||
return processSingleMessage(event.message, { | ||
return processWarehouseMessage(event.message, { | ||
metadata: event.metadata, | ||
whSchemaVersion, | ||
whStoreEvent, | ||
getDataTypeOverride, | ||
provider, | ||
sourceCategory: event.metadata ? event.metadata.sourceCategory : null, | ||
destConfig: event.destination?.Config, | ||
}); | ||
} | ||
|
||
module.exports = { | ||
provider, | ||
process, | ||
getDataTypeOverride, | ||
}; |
Oops, something went wrong.