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

Tests for Framer #22

Merged
merged 6 commits into from
Sep 1, 2022
Merged

Tests for Framer #22

merged 6 commits into from
Sep 1, 2022

Conversation

yesoreyeram
Copy link
Contributor

@yesoreyeram yesoreyeram commented Sep 1, 2022

This PR adds tests Frame() method and tests for various data type converters.

This is placeholder/baseline for Framer implementation. Currently, the frame returns null for various data types. Eventually this needs to be fixed via Framer implementation in subsequent PRs.

Also these tests run via container.

Example data:

//  +-----------------+------------------+-------------------+-----------------+--------------------+--------------------+--------------------+-------------------+------------------+-----------------+----------------+-----------------+-----------------+-----------------+---------------------+-----------------+-----------------------------------+---------------------+-----------------+--------------------+------------------+--------------------+-------------------+
//  | Name: id        | Name: asciivalue | Name: bigintvalue | Name: blobvalue | Name: booleanvalue | Name: datevalue    | Name: decimalvalue | Name: doublevalue | Name: floatvalue | Name: inetvalue | Name: intvalue | Name: listvalue | Name: mapvalue  | Name: setvalue  | Name: smallintvalue | Name: textvalue | Name: timestampvalue              | Name: timeuuidvalue | Name: timevalue | Name: tinyintvalue | Name: tuplevalue | Name: varcharvalue | Name: varintvalue |
//  | Labels:         | Labels:          | Labels:           | Labels:         | Labels:            | Labels:            | Labels:            | Labels:           | Labels:          | Labels:         | Labels:        | Labels:         | Labels:         | Labels:         | Labels:             | Labels:         | Labels:                           | Labels:             | Labels:         | Labels:            | Labels:          | Labels:            | Labels:           |
//  | Type: []*string | Type: []*string  | Type: []*int64    | Type: []*string | Type: []*bool      | Type: []*time.Time | Type: []*float64   | Type: []*float64  | Type: []*float64 | Type: []*string | Type: []*int64 | Type: []*string | Type: []*string | Type: []*string | Type: []*int64      | Type: []*string | Type: []*time.Time                | Type: []*string     | Type: []*uint64 | Type: []*int64     | Type: []*string  | Type: []*string    | Type: []*uint64   |
//  +-----------------+------------------+-------------------+-----------------+--------------------+--------------------+--------------------+-------------------+------------------+-----------------+----------------+-----------------+-----------------+-----------------+---------------------+-----------------+-----------------------------------+---------------------+-----------------+--------------------+------------------+--------------------+-------------------+
//  | null            | null             | 1                 | null            | true               | null               | 1.1                | 2.2               | 3.3              | null            | 2              | null            | null            | null            | 3                   | bravo           | 2021-09-07 16:40:31.123 +0000 UTC | null                | 36930123456789  | 5                  | null             | charlie            | 4                 |
//  +-----------------+------------------+-------------------+-----------------+--------------------+--------------------+--------------------+-------------------+------------------+-----------------+----------------+-----------------+-----------------+-----------------+---------------------+-----------------+-----------------------------------+---------------------+-----------------+--------------------+------------------+--------------------+-------------------+

queries used:

CREATE TABLE IF NOT EXISTS grafana.tempTable1 (
    id uuid PRIMARY KEY,
    asciivalue ascii,
    textvalue text,
    varcharvalue varchar,
    blobvalue blob,
    booleanvalue boolean,
    decimalvalue decimal,
    doublevalue double,
    floatvalue float,
    inetvalue inet,
    bigintvalue bigint,
    intvalue int,
    smallintvalue smallint,
    varintvalue varint,
    tinyintvalue tinyint,
    timevalue time,
    timestampvalue timestamp,
    datevalue date,
    timeuuidvalue timeuuid,
    mapvalue map<int,text>,
    listvalue list<text>,
    setvalue set<text>,
    tuplevalue tuple<int, text, float>
);
INSERT INTO grafana.tempTable1 (
    id,
    asciivalue,
    textvalue,
    varcharvalue,
    blobvalue,
    booleanvalue,
    decimalvalue,
    doublevalue,
    floatvalue,
    inetvalue,
    bigintvalue,
    intvalue,
    smallintvalue,
    varintvalue,
    tinyintvalue,
    timevalue,
    timestampvalue,
    datevalue,
    timeuuidvalue,
    mapvalue,
    listvalue,
    setvalue,
    tuplevalue
) VALUES (
    f066f76d-5e96-4b52-8d8a-0f51387df76b,
    'alpha',
    'bravo',
    'charlie',
    textAsBlob('foo'),
    true,
    1.1,
    2.2,
    3.3,
    '127.0.0.1',
    1,
    2,
    3,
    4,
    5,
    '10:15:30.123456789',
    '2021-09-07T16:40:31.123Z',
    '2021-09-07',
    30821634-13ad-11eb-adc1-0242ac120002,
    {1: 'a', 2: 'b', 3: 'c'},
    ['a', 'b', 'c'],
    {'a', 'b', 'c'},
    (3, 'bar', 2.1)
);

@yesoreyeram yesoreyeram changed the title Test framer Tests for Framer Sep 1, 2022
Copy link
Contributor

@scottlepp scottlepp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Updated this task to include types here that are null.

// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: |
// | Type: []*string | Type: []*string | Type: []*int64 | Type: []*string | Type: []*bool | Type: []*time.Time | Type: []*float64 | Type: []*float64 | Type: []*float64 | Type: []*string | Type: []*int64 | Type: []*string | Type: []*string | Type: []*string | Type: []*int64 | Type: []*string | Type: []*time.Time | Type: []*string | Type: []*uint64 | Type: []*int64 | Type: []*string | Type: []*string | Type: []*uint64 |
// +-----------------+------------------+-------------------+-----------------+--------------------+--------------------+--------------------+-------------------+------------------+-----------------+----------------+-----------------+-----------------+-----------------+---------------------+-----------------+-----------------------------------+---------------------+-----------------+--------------------+------------------+--------------------+-------------------+
// | null | null | 1 | null | true | null | 1.1 | 2.2 | 3.3 | null | 2 | null | null | null | 3 | bravo | 2021-09-07 16:40:31.123 +0000 UTC | null | 36930123456789 | 5 | null | charlie | 4 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you sync with main blob should work now.

CREATE TABLE IF NOT EXISTS grafana.tempTable1 (
id uuid PRIMARY KEY,
asciivalue ascii,
textvalue text,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe fix these indents to make them consistent

@scottlepp scottlepp merged commit 15b9678 into main Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants