-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Date/Timestamp SQL Insert format #10
Comments
Hi @gallejesus, you are surely right. I haven't tested this on dates yet, I can take a look at it in the next few days. |
@gallejesus I tried to replicate this locally without success - meaning that without any changes to the code, my date column in the postgres source was written as a date to Oracle. If you have anything to help me replicate it, let me know and I can hopefully identify the problem. The output from the postgres tap was as follows (singer message records):
Note the You can test this yourself by saving the singer records to a file and run |
Hi @radbrt, Yes, I can replicate your case and it works fine, so there must be something with how records are extracted and passed into the target. So I'm running postgres and oracle (free version) in docker containers: docker run -d --network host --name oracle container-registry.oracle.com/database/free:latest
docker run -d --network host -e POSTGRES_PASSWORD=pwd postgres And this is my meltano.yml file: version: 1
default_environment: dev
project_id: bac4eb1b-c776-4cfc-a62c-e081fb552a56
environments:
- name: dev
- name: staging
- name: prod
plugins:
extractors:
- name: tap-postgres
variant: meltanolabs
pip_url: git+https://github.com/MeltanoLabs/tap-postgres.git
config:
batch_config:
encoding:
compression: gzip
format: jsonl
storage:
prefix: ''
root: /tmp
database: postgres
host: localhost
user: postgres
select:
- public-YAY_DATEA.*
loaders:
- name: target-oracle
variant: radbrt
pip_url: git+https://github.com/radbrt/target-oracle.git
config:
database: FREE
host: localhost
port: '1521'
username: system
sqlalchemy_url: oracle+cx_oracle://system:oracle@localhost:1521/FREE
prefer_float_over_numeric: false The table in postgres has been created using this DDL and some examples inserts: CREATE TABLE public."YAY_DATEA" (
"XID" INTEGER,
"VAL" VARCHAR(4000),
"DT" DATE
);
INSERT INTO public."YAY_DATEA" ("XID", "VAL", "DT")
VALUES
(1, 'Value1', '2024-01-02'),
(2, 'Value2', '2024-01-03'),
(3, 'Value3', '2024-01-04'); Executing this pipeline in this way: meltano run tap-postgres target-oracle This is the error message I'm getting (that is the one refering about the format for the dates):
Let me know if with this you can replicate the scenario and get the same issue. Thank you! |
Thank you @gallejesus. I was able to replicate it now. The error message is indeed very confusing and I haven't gotten to the bottom of it yet, but it seems to be related to batch messages. If I removed the batch config on the tap, it did not trigger an error. I'll look into it more, batch messages are great, but I have no idea how long it will take to fix this. |
Yes! It is true it works without batching, I can work with this and continue playing with it. If I take a deeper look and find something that may be helpful to fix it I'll let you know here. Thank you! |
Hi!
I'm having issues using target when inserting Date and Timestamp format. I believe the target is not overwriting the SQL for insrts and the SQL statement singer is building is of this format:
Which for oracle fails as it is inseting dates with plain strings not casting to dates o adding the date keyword before the str.
Am I missing some config to tune this insert statement?
Thank you!
The text was updated successfully, but these errors were encountered: