|
| 1 | +=============== |
| 2 | +SingleStore Connector |
| 3 | +=============== |
| 4 | + |
| 5 | +The SingleStore connector allows querying and creating tables in an external |
| 6 | +SingleStore database. This can be used to join data between different |
| 7 | +systems like SingleStore and Hive, or between two different SingleStore instances. |
| 8 | + |
| 9 | +Configuration |
| 10 | +------------- |
| 11 | + |
| 12 | +To configure the SingleStore connector, create a catalog properties file |
| 13 | +in ``etc/catalog`` named, for example, ``singlestore.properties``, to |
| 14 | +mount the SingleStore connector as the ``singlestore`` catalog. |
| 15 | +Create the file with the following contents, replacing the |
| 16 | +connection properties as appropriate for your setup: |
| 17 | + |
| 18 | +.. code-block:: none |
| 19 | +
|
| 20 | + connector.name=singlestore |
| 21 | + connection-url=jdbc:singlestore://localhost:3306 |
| 22 | + connection-user=root |
| 23 | + connection-password=LbRootPass1 |
| 24 | +
|
| 25 | +The ``connection-url`` defines the connection information and parameters to pass |
| 26 | +to the SingleStore JDBC driver. The supported parameters for the URL are |
| 27 | +available in the `SingleStore Connection String Parameters |
| 28 | +<https://docs.singlestore.com/cloud/developer-resources/connect-with-application-development-tools/connect-with-java-jdbc/the-singlestore-jdbc-driver/#connection-string-parameters>`_. |
| 29 | + |
| 30 | +The ``connection-user`` and ``connection-password`` are typically required and |
| 31 | +determine the user credentials for the connection, often a service user. |
| 32 | + |
| 33 | +Multiple SingleStore Servers |
| 34 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 35 | + |
| 36 | +You can have as many catalogs as you need, so if you have additional |
| 37 | +SingleStore servers, simply add another properties file to ``etc/catalog`` |
| 38 | +with a different name (making sure it ends in ``.properties``). For |
| 39 | +example, if you name the property file ``sales.properties``, Presto |
| 40 | +will create a catalog named ``sales`` using the configured connector. |
| 41 | + |
| 42 | +Querying SingleStore |
| 43 | +-------------------- |
| 44 | + |
| 45 | +The SingleStore connector provides a schema for every SingleStore *database*. |
| 46 | +You can see the available SingleStore databases by running ``SHOW SCHEMAS``:: |
| 47 | + |
| 48 | + SHOW SCHEMAS FROM singlestore; |
| 49 | + |
| 50 | +If you have a SingleStore database named ``web``, you can view the tables |
| 51 | +in this database by running ``SHOW TABLES``:: |
| 52 | + |
| 53 | + SHOW TABLES FROM singlestore.web; |
| 54 | + |
| 55 | +You can see a list of the columns in the ``clicks`` table in the ``web`` database |
| 56 | +using either of the following:: |
| 57 | + |
| 58 | + DESCRIBE singlestore.web.clicks; |
| 59 | + SHOW COLUMNS FROM singlestore.web.clicks; |
| 60 | + |
| 61 | +Finally, you can access the ``clicks`` table in the ``web`` database:: |
| 62 | + |
| 63 | + SELECT * FROM singlestore.web.clicks; |
| 64 | + |
| 65 | +If you used a different name for your catalog properties file, use |
| 66 | +that catalog name instead of ``singlestore`` in the above examples. |
| 67 | + |
| 68 | +SingleStore Connector Limitations |
| 69 | +--------------------------- |
| 70 | + |
| 71 | +The following SQL statements are not yet supported: |
| 72 | + |
| 73 | +* :doc:`/sql/create-table` with ``rowstore`` table type (supports only ``columnstore`` table type, set by default `docs <https://docs.singlestore.com/cloud/reference/sql-reference/data-definition-language-ddl/create-table/>`_.) |
| 74 | +* :doc:`/sql/alter-schema` |
| 75 | +* :doc:`/sql/analyze` |
| 76 | +* :doc:`/sql/create-role` |
| 77 | +* :doc:`/sql/create-schema` |
| 78 | +* :doc:`/sql/create-view` |
| 79 | +* :doc:`/sql/delete` |
| 80 | +* :doc:`/sql/drop-role` |
| 81 | +* :doc:`/sql/grant` |
| 82 | +* :doc:`/sql/revoke` |
| 83 | +* :doc:`/sql/show-grants` |
| 84 | +* :doc:`/sql/show-roles` |
| 85 | +* :doc:`/sql/show-role-grants` |
| 86 | +* :doc:`/sql/set-role` |
0 commit comments