Hi! I am facing issues with moving JSON data from ...
# replication-ask-ai
a
Hi! I am facing issues with moving JSON data from MySQL to Clickhouse. The sync always fails during DBT Run.
k
I'm sorry to hear that you're having issues with your data sync from MySQL to Clickhouse. Based on the information provided in the extracts, it seems like a similar issue was encountered by a user in the [Airbyte forum](https://discuss.airbyte.io/t/3350). The error message indicated that dbt was unable to connect to the specified database and suggested checking the database credentials. Here are a few steps you can take to troubleshoot this issue: 1. Check your database credentials: Make sure that the credentials provided for your Clickhouse database are correct. You can refer to the [Airbyte documentation](https://docs.airbyte.com/integrations/destinations/clickhouse) for more details on how to set up your Clickhouse destination. 2. Check your Airbyte and connector versions: Ensure that you're using the latest versions of Airbyte and your source and destination connectors. The user in the forum post was using Airbyte version 0.40.14, Microsoft SQL Server (MSSQL) version 0.4.22, MySQL version 1.0.3, and Clickhouse ALPHA version 0.2.0. 3. Check your logs: The logs can provide more detailed information about the error. In the forum post, the user found that the error was related to an unexpected packet from the server. 4. Try disabling normalization: The user in the forum post mentioned that the issue occurred when the normalized tabular data option was selected in the transformation tab. You could try disabling this option to see if it resolves the issue. If none of these steps resolve the issue, I would recommend reaching out to the Airbyte community on their [forum](https://discuss.airbyte.io) or [Slack](https://airbytehq.slack.com) for further assistance.
a
I require tabular normalization so I can't disable that. @kapa.ai
k
Sure, you can enable Basic Normalization in Airbyte to convert your data into a tabular format. This is done during the connection setup in the "Normalization and Transformation" section. Here's an example of how Basic Normalization works. If your source emits data that looks like this:
Copy code
json {    "make": "alfa romeo",    "model": "4C coupe",    "horsepower": "247"   }
The destination connectors produce a raw table in the destination database:
Copy code
sql CREATE TABLE "_airbyte_raw_cars" (    "_airbyte_ab_id" VARCHAR,   "_airbyte_emitted_at" TIMESTAMP_WITH_TIMEZONE,   "_airbyte_data" JSONB  );
Then, Basic Normalization would create the following table:
Copy code
sql CREATE TABLE "cars" (    "_airbyte_ab_id" VARCHAR,    "_airbyte_emitted_at" TIMESTAMP_WITH_TIMEZONE,    "_airbyte_cars_hashid" VARCHAR,    "_airbyte_normalized_at" TIMESTAMP_WITH_TIMEZONE,    "make" VARCHAR,    "model" VARCHAR,    "horsepower" INTEGER   );
Please note that not all destinations support normalization. The destinations that currently support Basic Normalization are BigQuery, MS Server SQL, MySQL, Postgres, Redshift, and Snowflake. For MySQL, the server must support the
WITH
keyword and require MySQL >= 8.0, or MariaDB >= 10.2.1. You can find more details about Basic Normalization in the [Airbyte Documentation](https://docs.airbyte.com/understanding-airbyte/basic-normalization/).