Michal Ďurik
05/03/2024, 9:10 AMBuzzCutNorman
05/03/2024, 9:37 AMMichal Ďurik
05/03/2024, 9:49 AMBuzzCutNorman
05/03/2024, 9:55 AMMichal Ďurik
05/03/2024, 9:57 AMBuzzCutNorman
05/03/2024, 10:00 AMBuzzCutNorman
05/03/2024, 10:09 AMBuzzCutNorman
05/03/2024, 2:31 PMindex
. The select I put in the meltano.yml looks like this
select:
- 'dbo-ColumnTrouble.*'
I did a meltano install --clean
then set driver_type: pymssql
ran meltano select tap-mssql --list
to make sure the table was selected. Then ran meltano invoke tap-mssql
and got all the rows without error. I also ran meltano run tap-mssql target-postgres
and all the data wrote without error.
Please give the following command a try meltano install --clean
and then in your config only select the table with the index
column and try meltano invoke tap-mssql
and let me know what happens.
use [testdata]
go
/*********************************
Create the simple test table
in an MSSQL database
*********************************/
DROP TABLE IF EXISTS [ColumnTrouble];
CREATE TABLE ColumnTrouble (
Id int IDENTITY(1,1) PRIMARY KEY,
Item varchar(255) NOT NULL,
[index] int,
);
go
/*********************************
Insert some test data into the
test table
*********************************/
INSERT INTO [testdata].[dbo].[ColumnTrouble]
([Item]
,[index])
VALUES
('Park Ticket', 100)
,('Churro', 200)
,('Lunch', 300)
,('Character Signature', 400)
;
go
/********************************
Query the new test tables
********************************/
select * from ColumnTrouble;
Michal Ďurik
05/03/2024, 4:03 PMMichal Ďurik
05/06/2024, 7:13 AMrun meltano install --clean
, meltano invoke tap-mssql
and this went without error but meltano run
threw me the same error as before.Michal Ďurik
05/06/2024, 7:16 AMindex
is bigint, null
in my case.Michal Ďurik
05/06/2024, 7:20 AMmeltano invoke
output is:
{"type": "RECORD", "stream": "dbo-Redirect", "record" : {"Id": 1, "SourceUrl": "SOME_URL", "Index": 2097}, "time_extracted": "SOME_TIME"}
Michal Ďurik
05/06/2024, 7:43 AMBuzzCutNorman
05/06/2024, 2:20 PMIndex
stream property might be the quickest path to a resolution.Michal Ďurik
05/06/2024, 2:23 PMmeltano-map-transform
as well but without success.BuzzCutNorman
05/06/2024, 8:44 PMstream_maps
needs to be in the config:
. This definition crosswalk was helpful to me when looking at the source database and stream map config.
• stream = table
• property = column
I found an example that showed how you can __NULL__
or remove a stream's property but then match the property's value to a new property name. A config like this one should get you past the issue.
plugins:
extractors:
- name: tap-mssql
variant: buzzcutnorman
pip_url: git+<https://github.com/BuzzCutNorman/tap-mssql.git>
config:
dialect: mssql
driver_type: pymssql
host: server
user: user
database: database
stream_maps:
dbo-Redirect:
Index: __NULL__
ColumnIndex: index
select:
- 'dbo-Redirect.*'
When I get tap-mssql upgraded to SDK 0.37 you can do a more global fix I think. https://github.com/meltano/sdk/releases/tag/v0.37.0Michal Ďurik
05/07/2024, 10:30 AMstream_maps:
dbo-Redirect:
Index: __NULL__
index_field: str(Index)
Michal Ďurik
05/07/2024, 1:29 PMMichal Ďurik
05/07/2024, 1:30 PMMichal Ďurik
05/07/2024, 1:33 PMindex
(or another mssql keyword as well).
Do you think this is the right approach or could I edit some schema where it would be replaced?
I’m not sure what the right approach is or how I should do it.BuzzCutNorman
05/07/2024, 2:22 PMloaders:
- name: target-mssql
namespace: target_mssql
pip_url: git+<https://github.com/BuzzCutNorman/target-mssql.git>
capabilities:
- about
- stream-maps
- schema-flattening
- target-schema
settings:
- name: dialect
- name: driver_type
- name: host
- name: port
kind: integer
- name: user
- name: password
kind: string
sensitive: true
- name: database
- name: driver
- name: default_target_schema
- name: sqlalchemy_url_query
kind: object
- name: driver
- name: sqlalchemy_eng_params
kind: object
- name: fast_executemany
- name: future
- name: TrustServerCertificate
- name: batch_config
kind: object
- name: encoding
kind: object
- name: format
- name: compression
- name: storage
kind: object
- name: root
- name: prefix
- name: start_date
value: '2010-01-01T00:00:00Z'
- name: hd_jsonschema_types
kind: boolean
config:
Edgar Ramírez (Arch.dev)
05/07/2024, 4:13 PM*'Index' is a required property* and *Failed validating 'required' in schema.*
thanks to https://github.com/meltano/sdk/pull/2225BuzzCutNorman
05/07/2024, 4:21 PMMichal Ďurik
05/07/2024, 4:29 PMBuzzCutNorman
05/07/2024, 10:31 PMmeltano lock --update
then meltano install --clean
.BuzzCutNorman
05/08/2024, 1:57 PMMichal Ďurik
05/08/2024, 1:59 PMBuzzCutNorman
05/08/2024, 2:01 PMMichal Ďurik
05/10/2024, 7:59 AM