Skip to content
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

vdk-postgres: type inference for ingestion #3218

Open
DeltaMichael opened this issue Mar 18, 2024 · 0 comments
Open

vdk-postgres: type inference for ingestion #3218

DeltaMichael opened this issue Mar 18, 2024 · 0 comments
Milestone

Comments

@DeltaMichael
Copy link
Contributor

Overview

The postgres plugin does not infer the types based on the existing table when doing ingestion. The plugin should infer the types based on the columns, even though strings are passed. The below code should work and write float value in the float_data column and and integer value in the int_data column, even though they're passed as strings in the payload.

create table test_table (
    id number,
    str_data varchar2(255),
    int_data number,
    nan_int_data number,
    float_data float,
    bool_data number(1),
    timestamp_data timestamp,
    decimal_data decimal(14,8),
    primary key(id))
import math


def run(job_input):
    payload = {
        "id": "5",
        "str_data": "string",
        "int_data": "12",
        "nan_int_data": math.nan,
        "float_data": "1.2",
        "bool_data": "False",
        "timestamp_data": "2023-11-21T08:12:53.43726",
        "decimal_data": "0.1",
    }

    job_input.send_object_for_ingestion(payload=payload, destination_table="test_table")

Acceptance Criteria

  1. The above scenario is supported
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant