-
Notifications
You must be signed in to change notification settings - Fork 3
fix: use official SQL syntax from Spanner documentation for singers sample #475
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @apstndb, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request addresses a critical issue where the singers sample database failed to load in the embedded Spanner emulator due to non-compliant SQL syntax. The changes align the sample data's SQL with the official Spanner documentation, ensuring the sample database initializes correctly and consistently.
Highlights
- SQL Syntax Correction: Resolved a SQL syntax error in the
singerssample database that prevented the embedded emulator from starting. The error was due to incorrect string literal concatenation. - Spanner Documentation Alignment: Updated the sample data to strictly adhere to the official SQL syntax and data values provided in the Spanner documentation. This includes using double quotes for string literals and adjusting data entries.
- Apostrophe Handling: Ensured proper handling of apostrophes within song titles, such as "Let's Get Back Together", to prevent parsing errors.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly fixes a critical SQL syntax error in the singers-data.sql sample file, allowing the embedded emulator to start. The changes align the sample data with the official Spanner documentation by using the correct string literal syntax and data values. However, by removing data for the Concerts table and the MarketingBudget column, the data file is now inconsistent with the singers-schema.sql file, which still defines these elements. This could be confusing for users. I have added a comment to highlight this discrepancy for future improvement.
Code Metrics Report📊 View detailed coverage report (available for 7 days)
Details | | main (962099c) | #475 (8d29b25) | +/- |
|---------------------|----------------|----------------|-------|
- | Coverage | 70.0% | 69.9% | -0.2% |
| Files | 53 | 53 | 0 |
| Lines | 5765 | 5765 | 0 |
- | Covered | 4041 | 4034 | -7 |
| Code to Test Ratio | 1:1.2 | 1:1.2 | 0.0 |
| Code | 13163 | 13163 | 0 |
| Test | 16457 | 16457 | 0 |
| Test Execution Time | 34s | 34s | 0s |Code coverage of files in pull request scope (66.6% → 64.9%)
Reported by octocov |
…ample The embedded emulator was failing with SQL syntax errors when loading the singers sample database. Updated to use the exact SQL from the official Spanner documentation at: https://cloud.google.com/spanner/docs/query-execution-operators Changes: - Use double quotes for string literals (Spanner standard) - Use exact data values from the official documentation - Properly handle apostrophes in song titles like "Let's Get Back Together"
c8a7cd8 to
be74104
Compare
|
/gemini summary |
Summary of ChangesThis pull request addresses a critical issue preventing the embedded Spanner emulator from starting by correcting SQL syntax within the singers sample database. The changes bring the sample data in line with official Google Cloud Spanner documentation, ensuring proper string literal handling and data values, which resolves the startup failure and improves the reliability of the sample. Highlights
Changelog
Activity
|
Summary
Fixes SQL syntax error in the singers sample database that was causing the embedded emulator to fail on startup.
Problem
The embedded emulator was failing with this error:
Solution
Updated the singers sample data to use the exact SQL syntax from the official Spanner documentation:
https://cloud.google.com/spanner/docs/query-execution-operators
Changes
Testing
Verified the fix works: