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

Unable to UNION records with 'bit' column. #178

Open
pavel-orlov opened this issue Aug 31, 2023 · 1 comment
Open

Unable to UNION records with 'bit' column. #178

pavel-orlov opened this issue Aug 31, 2023 · 1 comment

Comments

@pavel-orlov
Copy link

Compatibility version: 1.2

[Error] Failed to compile the query script: Schemas of streams in union should match exactly. Column 'aa.bb' from left side has incompatible type 'bit' vs 'bit' from right side..

@k-krupka
Copy link

k-krupka commented Feb 6, 2024

+1

with
RawQuery as
(
    SELECT
        timestamp,
        TRY_CAST(0 AS bit) as 'PLSGFSSP1DA1_Device1_Load',
        TRY_CAST(1 AS bit) as 'PLSGFSSP2DA1_Device1_Load'
    FROM
        [telemetry]
),
DataForCompressor as
(
    SELECT         
        timestamp,
        TRY_CAST(PLSGFSSP1DA1_Device1_Load as bit) as Load
    FROM [RawQuery] 
    UNION 
    SELECT         
        timestamp,
        TRY_CAST(PLSGFSSP2DA1_Device1_Load as bit) as Load
    FROM
        [telemetry]
)
SELECT     *
INTO       [ModbusSensorStreamV2]
FROM        [DataForCompressor]

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

No branches or pull requests

3 participants
@k-krupka @pavel-orlov and others