Rahul Sawale
02/19/2024, 6:02 AMtap-mssql
to copy data into target-jsonl
. It looks like tap-mssql
supports decimal value upto Decimal('1E-17'). Any way to change configuration or increase size for decimal values?
jsonschema.exceptions.ValidationError: Decimal('0.002045454545454545') is not a multiple of Decimal('1E-17') cmd_type=elb consumer=True name=target-jsonl producer=False stdio=stderr string_id=target-jsonl
Failed validating 'multipleOf' in schema['properties']['col_name']: Decimal('0.002045454545454545')
Edgar Ramírez (Arch.dev)
02/19/2024, 4:52 PMmultipleOf
property of the field's schema using Meltano's schema extra.steve_clarke
02/19/2024, 9:39 PMuse_singer_decimal
if you are using the following tap https://github.com/wintersrd/pipelinewise-tap-mssql.
I choose to move numeric data as strings to avoid rounding issues. In the target system I cast the data to the appropriate datatype. I understand there is more work, however it is a lot safer especially where you are working with decimal data with a large precision and scale.
We have a custom version of target snowflake which will read the additional properties and will correctly cast the data as it is loaded into Snowflake. Otherwise cast the data to the correct numeric in your transform tool.
Optional:
To emit all numeric values as strings and treat floats as string data types for the target, set use_singer_decimal to true. The resulting SCHEMA message will contain an attribute in additionalProperties containing the scale and precision of the discovered property:
"property": {
"inclusion": "available",
"format": "singer.decimal",
"type": [
"null",
"number"
],
"additionalProperties": {
"scale_precision": "(12,0)"
}
Usage:
{
"use_singer_decimal": true
}
Rahul Sawale
02/20/2024, 10:06 AMuse_singer_decimal
setting it to True, but getting below error
jsonschema.exceptions.ValidationError: '0.0000' is not of type 'null', 'number' cmd_type=elb consumer=True name=target-jsonl producer=False stdio=stderr string_id=target-jsonl
Failed validating 'type' in schema['properties']['col_name']: cmd_type=elb consumer=True name=target-jsonl producer=False stdio=stderr string_id=target-jsonl
2024-02-20T06:46:36.240386Z [info ] {'additionalProperties': {'scale_precision': '(None,4)'}, cmd_type=elb consumer=True name=target-jsonl producer=False stdio=stderr string_id=target-jsonl
2024-02-20T06:46:36.240465Z [info ] 'format': 'singer.decimal', cmd_type=elb consumer=True name=target-jsonl producer=False stdio=stderr string_id=target-jsonl
2024-02-20T06:46:36.240543Z [info ] 'inclusion': 'available', cmd_type=elb consumer=True name=target-jsonl producer=False stdio=stderr string_id=target-jsonl
2024-02-20T06:46:36.240666Z [info ] 'type': ['null', 'number']} cmd_type=elb consumer=True name=target-jsonl producer=False stdio=stderr string_id=target-jsonl
steve_clarke
02/20/2024, 8:14 PMRahul Sawale
02/21/2024, 5:46 AMtap.properties.json
"DLD_ExemptAmount": {
"inclusion": "available",
"format": "singer.decimal",
"type": [
"null",
"number"
],
"additionalProperties": {
"scale_precision": "(None,4)"
}
}
Also find below column data type in SQL server databaseRahul Sawale
02/21/2024, 5:55 AM-481104.0000
-171317.0000
-67.9900
-67.1000
-66.8600
-1.2400
-0.5800
-0.0900
0.0000
0.0100
0.0500
0.0600
0.1300
18.9500
19.1800
19.2400
19.4000
19.4400
steve_clarke
02/22/2024, 12:28 AMRahul Sawale
02/22/2024, 6:43 AMsteve_clarke
02/26/2024, 4:30 AMsteve_clarke
02/26/2024, 8:41 PMRahul Sawale
02/27/2024, 4:38 AMRahul Sawale
02/27/2024, 1:58 PMjsonschema.exceptions.ValidationError: '75.0000' is not of type 'null', 'number'
2024-02-27T12:09:22.084186Z [info ] {'additionalProperties': {'scale_precision': '(None,4)'}, cmd_type=elb consumer=True name=target-jsonl producer=False stdio=stderr string_id=target-jsonl
2024-02-27T12:09:22.084348Z [info ] 'format': 'singer.decimal', cmd_type=elb consumer=True name=target-jsonl producer=False stdio=stderr string_id=target-jsonl
2024-02-27T12:09:22.084509Z [info ] 'inclusion': 'available', cmd_type=elb consumer=True name=target-jsonl producer=False stdio=stderr string_id=target-jsonl
2024-02-27T12:09:22.084672Z [info ] 'type': ['null', 'number']}
Edgar Ramírez (Arch.dev)
02/27/2024, 8:18 PMPublish to PyPI
job:
Installing dependencies from lock file
pyproject.toml changed significantly since poetry.lock was last generated. Run `poetry lock [--no-update]` to fix the lock file.
Edgar Ramírez (Arch.dev)
02/27/2024, 8:18 PMsteve_clarke
02/27/2024, 8:22 PMsteve_clarke
02/28/2024, 5:30 AMmeltano install extractor tap-mssql --clean
Rahul Sawale
02/28/2024, 5:44 AM