This topic describes common issues and solutions for connecting to data sources in DataV.
What do I do if a database connection fails?
Depending on the database network type and region, add the DataV server IP address to your database whitelist or ECS security group settings. You can also use a proxy tool to connect to your database. For more information, see How to use DataV Proxy.
How do I configure a CSV data source?
Use the first row of the CSV file as the table header. The column names must match the field names that are required by the data structure of the corresponding chart.
Which data centers support internal connections to databases over the Alibaba Cloud classic network?
Currently, the China (Hangzhou), China (Shanghai), and China (Beijing) data centers are supported.
Can DataV connect to a database deployed on an ECS instance or another machine?
Yes, it can. You must expose the public IP address of your database. Whitelists are not currently supported for this connection method. For better security, use the proxy tool provided by Alibaba Cloud to connect to the database. For more information, see How to use DataV Proxy.
How do I choose between API, Alibaba Cloud API Gateway, and OpenAPI data sources?
| Data source type | Description | Application scenario in DataV |
| API | A generic data API. | If you have a ready-to-use API, connect to it using the API data source in DataV. Examples include APIs provided by existing sites or APIs built with purchased cloud services. For more information, see Add an API data source. |
| Alibaba Cloud API Gateway | An Alibaba Cloud product that provides API hosting services. | If the logic in your API is not supported by the DataV API data source, such as signature calculation, you can host your API on Alibaba Cloud API Gateway. DataV can then connect to the Alibaba Cloud API Gateway data source to indirectly call your hosted API. In this case, Alibaba Cloud API Gateway acts as a proxy for your API. For more information, see Add an Alibaba Cloud API Gateway data source. |
| OpenAPI | A method for calling the open APIs of Alibaba Cloud products. Use OpenAPI to easily call the APIs provided by various Alibaba Cloud products, typically to obtain information about them. | If you want to get data from Alibaba Cloud products, such as ECS load status or Simple Log Service (SLS) log statistics, use the OpenAPI data source in DataV. OpenAPI only supports calling APIs provided by Alibaba Cloud products. For more information, see Add an OpenAPI data source. |
When should I use an Alibaba Cloud API Gateway data source instead of a direct API data source?
DataV cannot directly call all types of APIs. In such cases, you can host your APIs on Alibaba Cloud API Gateway, which allows DataV to call them. Consider using an Alibaba Cloud API Gateway data source in the following scenarios:
- If your API uses a custom algorithm for signature authentication, DataV cannot call it directly. You can use Alibaba Cloud API Gateway to implement the custom algorithm logic and perform the authentication, which allows DataV to call your API.
- If DataV cannot directly access your API, for example, if your API is in a virtual private cloud (VPC), you can host it on Alibaba Cloud API Gateway.
- If you do not want to expose the implementation details of your API to DataV, you can use Alibaba Cloud API Gateway to hide the details and enable the connection.
- If your API uses a data source or interface that is not yet supported by DataV, such as calling Function Compute, you can also use Alibaba Cloud API Gateway to retrieve the data.
What do I do if a timeout error occurs when I configure a database data source?
- Confirm that you have configured the database whitelist.
- If your data source is ApsaraDB RDS, you must configure the RDS whitelist. Then, confirm whether you are using a virtual private cloud (VPC).
- If you are using a VPC, turn on the VPC switch and enter the VPC ID and Instance ID when you add the data source. Note You can obtain the VPC ID and Instance ID in the Alibaba Cloud VPC or RDS console. Ensure that there are no leading or trailing spaces when you enter the IDs.
- No. Please contact an Alibaba Cloud technical engineer for assistance.
- If you are using a VPC, turn on the VPC switch and enter the VPC ID and Instance ID when you add the data source.
How do I write an SQL statement when the callback ID is an array?
- Standard SQL
select * from tb where id in (:idList) - Stored procedure
function(concat_ws(',', :idList))NoteidListis the callback ID array that you configured.
How do I pass data to a carousel table?
Use the list carousel widget.
select field1 as "column1", filed2 as "column2", field3 as "column3" from tableHow do I pass data to a fly line layer?
You can pass the data using SQL. You only need to retrieve the data for the from and to fields. In each field, concatenate the longitude and latitude with a comma. This format is slightly different from the format for static data and APIs.
What do I do if a widget data request times out?
- Possible cause: The data query timed out. DataV limits requests to the database to 10 s. If a data query takes longer than 10 s, a timeout error occurs.
Solution: This limit is set by the DataV backend service and cannot be changed. You can optimize the SQL query statement or adjust the table schema to reduce the query time.
- Possible cause: The widget data query takes a long time, but the automatic update interval is short. The Chrome browser can send a maximum of six concurrent HTTP requests to the same domain name. Subsequent requests are queued in the browser and cannot be sent to the data center.
Solution: You can adjust the automatic update interval or optimize the SQL statement to reduce the data return time.
Note Solutions for long-running queries:- You can build your own data API service. The service must support cross-domain requests.
- You can optimize database queries. For example, you can create indexes based on common SQL query conditions to speed up queries.