How Google BigQuery & Generative AI can deliver unified SQL analytics banner

How Google BigQuery & Generative AI can deliver unified SQL analytics

Posted by

When it comes to real-time data analysis, e-commerce companies can no longer simply depend on numbers—they also need to analyze product images in every online purchase. Before the advent of GenAI, this task would involve a host of different tools, customized Python scripts, and even banging a few times on the keyboard.

That’s no longer the case. With Google BigQuery’s unified SQL analytics, e-commerce companies can now transform “traditional” SQL analytics into AI-powered SQL data analytics that allows them to interpret and extract insights from any form of data

Here’s an illustration of how Google BigQuery and GenAI can deliver unified SQL analytics.

Let’s take a deeper look at how this works.

What’s changed in BigQuery’s AI solution?

Among the latest developments on its AI front, Google’s BigQuery has included native support for large language models (LLMs) and computer vision capabilities. With BigQuery Generative AI, e-commerce companies can also integrate structured database queries with unstructured data analysis. 

How is this beneficial for e-commerce brands? They can effectively query the BigQuery engine to get answers to questions like:

  • How many products did customer X purchase in the previous month?
  • What did those purchased products look like?
  • What was the brand behind the purchased products?

Effectively, this means unlocking actionable insights from product image files. Next, let’s consider a real-world use case of unified SQL analytics using Google BigQuery.

BigQuery’s unified SQL analytics – use case

Here’s a real-world use case that showcases the capability of BigQuery’s unified SQL analytics:

Consider the following BigQuery table that lists customer transactions.

With the following columns:

  • “Customer” displays the name of the customer making the online purchase.
  • “OrderID” displays the unique ID of each purchase order.
  • “Price” displays the selling price of the product that was sold.
  • “Product” indicates the navigation path to the product image (stored on Google Cloud). Besides the product image, the product URI also contains contextual information about the purchased product, the company logo of the associated marketplace (for example, Amazon), and brand-related information.

Here’s an illustration of a product image dataset in the Google Cloud Storage (GCS) bucket.

Using external tables in unified SQL analytics

To implement unified SQL analytics using Google BigQuery, e-commerce companies need to first create an external table that links the BigQuery environment with the GCS bucket containing all the product images. By using an external table, companies don’t need to actually store all the product images in the BigQuery database, which is both expensive and unfeasible.

Instead, they only need to create a logical connection that allows BigQuery to reference the image files just like any native database object. External tables allow BigQuery to process unstructured images using the same SQL commands (as with traditional tabular data). By using external tables, companies can easily:

  • Reference image files in their database queries.
  • Apply filters depending on the file properties.
  • Pass the referenced images to custom AI models for analysis (within the BigQuery environment).

Here’s an example:

How GenAI models can analyze images

By integrating with Generative AI models, Google BigQuery enables e-commerce companies to create custom AI models that can extract insights from product images. How does this work? GenAI models are specifically trained to identify specific elements in any product image, including:

  • An Amazon or Walmart logo (if present)
  • Product category
  • Any brand-related information
  • Visual data, such as the product’s color or size

Here’s a sample code:

With capabilities that extend beyond simple object identification, GenAI models serve as “intelligent” image interpreters that can:

  • Analyze the detailed composition of product images.
  • Identify any marketplace indicators (if present).
  • Recognize the brand positioning.
  • Extract relevant metadata that converts simple images into query-ready data points.
  • Converts unstructured visual data into structured insights to be integrated into any analytics workflow.

Why unified SQL analytics is the future

In essence, unified SQL analytics is the future as it brings together structured transaction tables with AI-generated insights from product images. With a single SQL query, companies can obtain valuable information like:

  • How much has customer X been spending in recent months?
  • Which marketplace is X using the most for online purchases?
  • How do X’s buying patterns correlate with brand presentations?
  • Which visual themes are dominating X’s buying patterns?

Besides, e-commerce companies can gauge if products (with selected marketplace logos) have a higher lifetime value, or find out if seasonal visual trends in product images can predict a sales surge in advance.

Through this unified approach, companies can eliminate the traditional barriers that have existed between structured and unstructured data analysis. They don’t need to choose between SQL analytics and image processing tools. This single unified platform helps them understand both their transactional data (in numbers) and the visual context of each online purchase. 

Here’s how e-commerce teams can leverage this capability:

  • Marketing teams can correlate campaign-related imagery with actual purchase behavior.
  • Inventory managers can predict product demand based on visual trends.
  • Customer experience teams can understand the impact of product presentation on the customer’s buying decisions.

Through this AI-powered innovation, Google has essentially “democratized” the power of multimodal data analysis to anyone who can write an SQL query. This is enabling traditional analysts to unlock valuable insights which were previously only accessible to specialized AI experts. 

Here’s a sample of an SQL query output:

Conclusion

With the advent of Google BigQuery’s unified SQL analytics, we’re witnessing the elimination of any barrier between structured and unstructured data analysis. This advanced analytical tool ensures that companies don’t need a separate workflow or specialized AI skills to analyze product imagery and transactional data. 

Enterprises adopting this analytics platform can have a competitive advantage over companies operating with traditional silos. Onix’s Generative AI solutions are designed for enterprises looking to maximize business value from their investments. Contact our team today.

Related blogs

Subscribe to stay in the know

Your trusted guide to everything cloud

No matter where you are on your journey, trusted Onix experts can support you every step of the way.