question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feast materialize runs into BigQuery syntax error

See original GitHub issue

Expected Behavior

No syntax error

Current Behavior

running feast materialize using BigQuerySource creates a query that has syntax errors

Steps to reproduce

  1. Run feast materialize
  2. Check the output and inspect the query as part of the job output
 google.api_core.exceptions.BadRequest: 400 Syntax error: Expected ")" but got "," at [4:58]

Query with invalid syntax (missing parenthesis)

SELECT InvoiceNo, Quantity, InvoiceDate,
FROM (
SELECT InvoiceNo, Quantity, InvoiceDate, ,
ROW_NUMBER() OVER(PARTITION BY InvoiceNo ORDER BY InvoiceDate DESC,  DESC) AS _feast_row
FROM `feast-feature-store:data.ecommerce`
WHERE InvoiceDate BETWEEN TIMESTAMP('2011-03-24 00:00:00+00:00') AND TIMESTAMP('2011-08-02 00:00:00+
7 00:00')
)
WHERE _feast_row = 1

The feature definition does not contain any extraordinary

from datetime import timedelta
from feast import BigQuerySource, Entity, Feature, FeatureView, ValueType


transactions = Entity(
    name="transactions",
    join_key="InvoiceNo",
    value_type=ValueType.INT64,
)


transactions_source= BigQuerySource(
    table_ref="feast-feature-store:data.ecommerce",
    event_timestamp_column="InvoiceDate",
)


transactions_view = FeatureView(
    name="transactions",
    entities=["transactions"],
    ttl=timedelta(weeks=52),
    features=[
        Feature(name="Quantity", dtype=ValueType.INT64)
    ],
    input=transactions_source,
    tags={"team": "driver_performance"},
)

Specifications

  • Version: 0.10
  • Platform: GCP
  • Subsystem:

Possible Solution

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
woopcommented, Apr 21, 2021

(In which way is feast using it?)

Whenever you have duplicated rows in your source (meaning a row with the same event_timestamp and InvoiceNo) then we deduplicate by taking the latest row based on created_timestamp. The created_timestamp is when the row was written to the source.

0reactions
SaschaHeyercommented, Apr 21, 2021

confirmed working after upgrading to 0.10.1 lovely ❤️

Materializing feature view transactions from 2011-03-24 00:00:00+01:00 to 2011-08-02 00:00:00+02:00 done!
Read more comments on GitHub >

github_iconTop Results From Across the Web

Quickstart - Feast
In this tutorial, we focus on a local deployment. For a more in-depth guide on how to use Feast with Snowflake / GCP...
Read more >
BigQuery Syntax Error with "(" - sql - Stack Overflow
I'm creating a query to uniformly distribute Facebook ad spend amount per ad id's. Syntax stopped me. SELECT t.lead_city, t.lead_time, t.
Read more >
Changelog - GitHub
... Fix materialization when running on Spark cluster. ... Fix workflow syntax error ([#2869](https://github.com/feast-dev/feast/issues/2869)) ...
Read more >
feast - PyPI
Python SDK for Feast. ... feature engineering rather than debugging error-prone dataset joining logic. ... Want to run the full Feast on Snowflake/GCP/AWS?...
Read more >
Machine Learning Feature Store Quickstart Tutorial | Redis
Install Redis and run Redis-Server in the background; Install Feast with Redis; Create a feature repository and define Redis as the online store ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found