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

Google BigQuery Node Returns Integer Values as String Instead of Number #10503

Closed
airatvibe opened this issue Aug 21, 2024 · 5 comments
Closed
Labels
in linear Issue or PR has been created in Linear for internal review Released

Comments

@airatvibe
Copy link

airatvibe commented Aug 21, 2024

Bug Description

I'm encountering an issue with the Google BigQuery node in n8n. When querying integer fields from BigQuery, the node returns the values as strings instead of numbers. This behavior can cause unexpected results in subsequent nodes that expect numeric data types.

Google BigQuery node version 2.1 (Latest)

Output example:
image

DB schema:

image

[
  {
    "name": "storeId",
    "mode": "NULLABLE",
    "type": "INTEGER",
    "description": "",
    "fields": []
  },
  {
    "name": "GLN",
    "mode": "NULLABLE",
    "type": "INTEGER",
    "description": "",
    "fields": []
  },
  {
    "name": "chainGLN",
    "mode": "NULLABLE",
    "type": "INTEGER",
    "description": "",
    "fields": []
  }
]

To Reproduce

  1. Set up a Google BigQuery node in n8n.
  2. Query a table that contains integer fields.
  3. Inspect the output from the BigQuery node.

Expected behavior

The integer fields should be returned as numbers.

Operating System

Alpine Linux v3.20

n8n Version

1.54.4

Node.js Version

3.4

Database

PostgreSQL

Execution mode

queue

@Joffcom
Copy link
Member

Joffcom commented Aug 21, 2024

Hey @AiratHalitov,

We have created an internal ticket to look into this which we will be tracking as "GHC-177"

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Aug 21, 2024
@airatvibe
Copy link
Author

airatvibe commented Aug 21, 2024

When I try to cast the values ​​to int type it doesn't help:

SELECT 
  CAST(storeId AS INT64) AS storeId,
  CAST(GLN AS INT64) AS GLN,
  CAST(chainGLN AS INT64) AS chainGLN
FROM `{{ $json.dbname }}`
LIMIT 10;

image

@Joffcom
Copy link
Member

Joffcom commented Sep 24, 2024

Hey @AiratHalitov,

This is likely to be where we don't support int64 fully as Javascript has issues with larger numbers. Instead a string is used to make sure the number is not rounded which would cause more issues.

@janober
Copy link
Member

janober commented Oct 2, 2024

Fix got released with n8n@1.62.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review Released
Projects
None yet
Development

No branches or pull requests

3 participants