Google Cloud Spanner scripting similar to PL/SQL or T-SQL? - scripting

New to Google Cloud Spanner. I am in a "research" role, not development. Is there a way to execute scripts with Cloud Spanner similar to PL/SQL or T-SQL?
I am currently using DBeaver Community to connect and execute SQL statements. Would like to be able to execute additional statements based on the result set(s) of a previously executed statement.
Thanks in advance.

Option 1 - GoogleSQL Dialect Databases
This open source project will give you an interactive command line tool for Google Cloud Spanner databases: https://github.com/cloudspannerecosystem/spanner-cli
Option 2 - PostgreSQL Dialect Databases
Cloud Spanner also supports databases that use the PostgreSQL dialect. You can use psql with Cloud Spanner databases that are created with the PostgreSQL dialect: https://cloud.google.com/spanner/docs/pgadapter

Related

Convert vectorwise queries into Synapse queries

Is there any third party tool which can convert Vectorwise query into Synapse queries?
Unfortunately, there is no such tool available.
Azure Synapse support T-SQL language to query and analyze the data. You can use standard ANSI-compliant dialect of SQL language used on SQL Server and Azure SQL Database for data analysis.
Since vectorwise query is similar to T-SQL, you can try if some of the statements supported by Synapse. Else, you need to write them in T-SQL and use.

Data Analysis in Splunk

How do you perform data analysis for Splunk?
I'm told there are no traditional DBs in Splunk - do you install non-relational DBs like mongoDB and configure it to connect to your Splunk instances/environments?
If you need to connect traditional databases to Splunk, use DB Connect
It supports
DB2/Linux, Informix, MemSQL, MySQL, AWS Aurora, Microsoft SQL Server, Oracle, PostgreSQL, AWS RedShift, SAP SQL Anywhere, Sybase ASE, Sybase IQ, and Teradata
Splunk is a data analysis tool
What use case(s) are you trying to solve that you think it should be/have a database?

Connecting to Cloud SQL server instance from BigQuery

There is an option to connect a Cloud mySQL instance from BigQuery. I just wanted to know how we can connect a Cloud SQL Server instance to BigQuery.
SQL Server:
There are a bunch of third-party extensions/tools that provide this service. One of them is SSIS Data Flow Source & Destination for Google BigQuery, which is Visual Studio extension that connects SQL Server with Google BigQuery data through SSIS Workflows.:
https://www.cdata.com/drivers/bigquery/ssis/
https://marketplace.visualstudio.com/items?itemName=CDATASOFTWARE.SSISDataFlowSourceDestinationforGoogleBigQuery
In regards to using SQL Server Integration Services to load the data from the on-premises SQL Server to BigQuery, you can take a look for this site. You can also perform ETL from a relational database into BigQuery using Cloud Dataflow, the official documentation details how it can be done, you might need to use Cloud Storage as an intermediate data sink.
Cloud SQL:
BigQuery allows to query data from Cloud SQL by using federated query. The connection must be created within the same project where your Cloud SQL instance is located. If you want to query your data stored in your Cloud SQL instance from BigQuery located in another project, please follow the steps listed below:
Enable the BigQuery API and the BigQuery connection API within your project.
Create a connection to your Cloud SQL instance within the project by following this documentation.
Once you have created the connection, please locate and select it within BigQuery.
Click on the SHARE CONNECTION button and grant permissions to the users that will be use that connection. Please note that the BigQuery Connection User role is the only needed to use a shared connection.
Additionally, please notice that the "Cloud SQL federated queries" feature is in a Beta stage and might change or have limited support (is no available for certain regions, in which case, it is required to use one the supported options mentioned here). Please remember, that to use Cloud SQL Federated queries in BigQuery, the intances need to have a public IP.
If you are limited e.g. by region, one good option might be exporting the data from CloudSQL to Storage as a CSV, and then load it into BigQuery. If you need, it is possible to automate this process using Cloud Composer, refer to this article.
Other approach is to extract information from Cloud SQL (with exports) and import it into BigQuery through load jobs, or streaming inserts.
I hope you find the above pieces of information useful.
It is possible, but be warned the feature is currently Beta
https://cloud.google.com/bigquery/docs/cloud-sql-federated-queries

How to connect GCP SQL instance by using Bigquery?

I need help for something, I'm new in Bigquery..
I want to see my SQL tables over Bigquery connection at the Data Studio. However I couldn't figure it out how to connect GCP mySQL instance from Bigquery.
I tried to change region/location of my SQL instance.(I think it helped a little) And using this query at the new BigQuery web UI.. but I receive below error.
SELECT *
FROM
myinstanceid.my_database_01.TABLE_YS ys
Error: ((Not found: Project myinstanceid))
You cannot directly connect MySQL databases the only external data sources supported are: GCS files, Cloud Bigtable, Google Drive (even directly google spreadsheets).
To run analytics on data inside your MySQL DB you will need to export data into a supported external data source or even better into a BigQuery native table.

Execute SQL Procedures in Hive

​Hi,
Below is the scenario we have, please suggest possible solutions,
We have an existing reporting solution (SAP) executing a procedure in RDBMS (using JDBC Connection) to generate reports based on the user input.
Now we are planning to move from RDBMS to hive as our data source.
Is there a way to connect to hive and execute a procedure (HPLSQL or a UDF performing an equivalent job of Oracle procedure) using a JDBC connection?
Or is there any alternate way to run a procedure or a program in hive or spark using jdbc?
Thanks
it is possible to connect to Hive using JDBC
https://cwiki.apache.org/confluence/display/Hive/HiveClient#HiveClient-JDBC
However if your cluster is secured, you will need to connect to HiveServer2
https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-JDBC
Plus to that, store procedures are supported in Hive from the 2.0.0 version
https://issues.apache.org/jira/browse/HIVE-11055