GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Syntax Error in BigQuery While Retrieving Columns that Start with a Number · Issue #4688 · feast-dev/feast

Syntax Error in BigQuery While Retrieving Columns that Start with a Number #4688

New issue
Copy link
New issue
Copy link
Closed
#4908
#4713
Closed
Syntax Error in BigQuery While Retrieving Columns that Start with a Number#4688
#4908
#4713
Copy link
Labels
kind/bugpriority/p2

Description

@nishantgaurav-dev
nishantgaurav-dev
opened on Oct 25, 2024
Issue body actions

Expected Behavior

We have a feature view like this:

mbr_visits_fv_v1 = FeatureView(
	...
    schema=[
        Field(name="7_days_visits", dtype=Int64),
        Field(name="30_daysvisits", dtype=Int64),
    ],
    source=mbr_visits_bq_ds_v1
    ...
)

While querying this view as offline features I am expecting a data-frame containing desired columns without any error.

Current Behavior

Feast SDK is giving error like:
google.api_core.exceptions.BadRequest: 400 Syntax error: Missing whitespace between literal and alias at ...

I have printed some logs and observed that the generated BQ query contains a segment like this:

SELECT
  event_timestamp as event_timestamp,
  mbr_id AS mbr_id,
  7_days_visits as 7_days_visits
  30_days_visits as 30_days_visits
FROM `myproj.my_dataset.mbr_visits`
WHERE event_timestamp <= '2024-06-27T00:00:00'

This is incorrect BQ query.

It should be like this:

SELECT
  event_timestamp as event_timestamp,
  mbr_id AS mbr_id,
  `7_days_visits` as `7_days_visits`
  `30_days_visits` as `30_days_visits`
FROM `myproj.my_dataset.mbr_visits`
WHERE event_timestamp <= '2024-06-27T00:00:00'

The BQ expects that if a queried column starts with a number, the name should be enclosed in backtick (`) chars.

Steps to reproduce

Try querying a feature view with column name starting with number and use BigQuery data source.

Specifications

  • Version: 0.34.1
  • Platform: Mac
  • Subsystem:

Possible Solution

Enclose all the BQ column names with backtick (`) chars. It will reduce the readability a little bit, but won't cause any performance impact.

Reacted by Dharmisha Doshi

Activity

  1. nishantgaurav-dev
    added
    kind/bug
    priority/p2
    on Oct 25, 2024
  2. nishantgaurav-dev
    changed the title [-]Syntactically incorrect BQ query while retrieving columns with number in the begining.[/-] [+]Syntax Error in BigQuery While Retrieving Columns that Start with a Number[/+] on Oct 25, 2024
  3. tmihalac commented on Oct 28, 2024

    @tmihalac
    tmihalac
    on Oct 28, 2024
    Contributor
    More actions

    "While querying this view as offline features I am expecting a data-frame containing desired columns without any error."
    Can you also explain how did you query this view, which api and also a stack trace of the exception will be helpful

  4. franciscojavierarceo
    closed this as completedin #4713on Oct 30, 2024
  5. nishantgaurav-dev
    added 3 commits that reference this issue on Nov 12, 2024

    Fixing issue feast-dev#4688

    a2a5f77

    Fixing issue feast-dev#4688

    9e3272e

    Fixing issue feast-dev#4688

    c0f99fa
  6. dharmisha
    added 9 commits that reference this issue on Jan 15, 2025

    Fixing issue feast-dev#4688

    3ba5558

    Fixing issue feast-dev#4688

    3f8ab2d

    Fixing issue feast-dev#4688

    a83f563

    Fixing issue feast-dev#4688

    23abc42

    Fixing issue feast-dev#4688

    ba4901b

    Fixing issue feast-dev#4688

    42b9a40

    Fixing issue feast-dev#4688

    776420b

    Fixing issue feast-dev#4688

    f29b869

    Fixing issue feast-dev#4688

    3fa7a10
  7. franciscojavierarceo
    added a commit that references this issue on Jan 19, 2025

    fix: Resolving syntax error while querying a feature view with column…

    d3495a0
  8. tmihalac
    added a commit that references this issue on Jan 21, 2025

    fix: Resolving syntax error while querying a feature view with column…

    029d4ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugpriority/p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.