![]() ![]() The name of the virtual table is generated by appending the name of the object or array field to the name of the parent table.įor virtual tables generated from object and array fields, the primary key name is the same as the parent table primary key name and is a foreign key back to the parent table. A parent table can be the base table or another virtual table in case of fields that have multiple levels of nesting. Object and array fields are mapped to separate virtual tables with a foreign key relationship back to the parent table. The following is an example of the cases table. The following is the generated table schema. "Combined_Key" : "Grayson, Kentucky, US", All other scalar fields (such as Boolean, Double, Date, and String) are mapped to a column in the base table.Īs shown in the following sample document from the cases collection, all fields are scalar fields: Amazon DocumentDB Collectionįor base tables, the primary key name is _id and is mapped to the _id field. The following table summarizes the base table names used in this post, based on our sample datasets. When the JDBC driver first connects to an Amazon DocumentDB cluster, it samples the documents in each collection and creates schemas based on the following behavior.Įach collection is mapped to a base table with the same name as the collection. This schema is used by the JDBC driver to provide a SQL interface for querying Amazon DocumentDB data. The JDBC driver performs automatic schema discovery, mapping collections to tables, documents to rows, and fields to columns. ![]() The following table compares terminology used by SQL databases with terminology used by Amazon DocumentDB. Mongoimport -db samples -collection movies -h :27017 -u -p -ssl -sslCAFile rds-combined-ca-bundle.pem -jsonArray -file moviedata.jsonįor more information on finding your Amazon DocumentDB cluster endpoint, see Finding a Cluster’s Endpoints.īefore you use the JDBC driver, it’s important to understand how it generates table schemas from documents stored in Amazon DocumentDB. Import cases.json into the cases collection: Connect and query data with DbVisualizer.įirst, import the sample datasets into the samples database in your Amazon DocumentDB cluster using the mongoimport tool.Connect and visualize data with Tableau Desktop.Load sample data to your Amazon DocumentDB cluster.The solution described in this post includes the following tasks: For more information on creating an external SSH tunnel, see Connecting to an Amazon DocumentDB Cluster from Outside an Amazon VPC.įor this post, we use the internal SSH tunnel option. Externally, using the SSH application.Internally, using the JDBC driver SSH tunnel options.There are two options to create an SSH tunnel for the JDBC driver: An Amazon Elastic Compute Cloud (Amazon EC2) instance running in the same VPC as your Amazon DocumentDB cluster is used for SSH tunneling. If you’re connecting to your Amazon DocumentDB cluster from outside the cluster’s VPC, the JDBC driver uses an SSH tunnel to connect to it. DbVisualizer to query data (for this post, we use the DbVisualizer Free version 12.1.3).Tableau Desktop to visualize data (for this post, 2021.2.2).This post assumes the default values for port (27017) and TLS (enabled) settings. You can use an existing Amazon DocumentDB cluster or create a new one. To implement this solution, you must have the following prerequisites: ![]() This post helps you download, install, and configure the Amazon DocumentDB JDBC driver with Tableau Desktop and DbVisualizer. With the Amazon DocumentDB JDBC driver, you can visualize JSON data with business intelligence (BI) tools like Tableau Desktop and run SQL queries on JSON data with developer tools like DbVisualizer. The Amazon DocumentDB JDBC driver provides a SQL interface that allows SQL-based tools to easily access JSON data stored in Amazon DocumentDB. SQL is the de facto standard for data and analytics and one of the most popular languages among data engineers and data analysts. Amazon DocumentDB (with MongoDB compatibility) is a scalable, highly durable, and fully managed database service for operating mission-critical MongoDB workloads. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |