recurvedata-lib 0.1.487__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of recurvedata-lib might be problematic. Click here for more details.
- recurvedata/__init__.py +0 -0
- recurvedata/__version__.py +1 -0
- recurvedata/client/__init__.py +3 -0
- recurvedata/client/client.py +150 -0
- recurvedata/client/server_client.py +91 -0
- recurvedata/config.py +99 -0
- recurvedata/connectors/__init__.py +20 -0
- recurvedata/connectors/_register.py +46 -0
- recurvedata/connectors/base.py +111 -0
- recurvedata/connectors/config_schema.py +1575 -0
- recurvedata/connectors/connectors/__init__.py +0 -0
- recurvedata/connectors/connectors/aliyun_access_key.py +30 -0
- recurvedata/connectors/connectors/auth.py +44 -0
- recurvedata/connectors/connectors/azure_blob.py +89 -0
- recurvedata/connectors/connectors/azure_synapse.py +79 -0
- recurvedata/connectors/connectors/bigquery.py +359 -0
- recurvedata/connectors/connectors/clickhouse.py +219 -0
- recurvedata/connectors/connectors/dingtalk.py +61 -0
- recurvedata/connectors/connectors/doris.py +215 -0
- recurvedata/connectors/connectors/es.py +62 -0
- recurvedata/connectors/connectors/feishu.py +65 -0
- recurvedata/connectors/connectors/ftp.py +50 -0
- recurvedata/connectors/connectors/generic.py +49 -0
- recurvedata/connectors/connectors/google_cloud_storage.py +115 -0
- recurvedata/connectors/connectors/google_service_account.py +225 -0
- recurvedata/connectors/connectors/hive.py +207 -0
- recurvedata/connectors/connectors/impala.py +210 -0
- recurvedata/connectors/connectors/jenkins.py +51 -0
- recurvedata/connectors/connectors/mail.py +89 -0
- recurvedata/connectors/connectors/microsoft_fabric.py +284 -0
- recurvedata/connectors/connectors/mongo.py +79 -0
- recurvedata/connectors/connectors/mssql.py +131 -0
- recurvedata/connectors/connectors/mysql.py +191 -0
- recurvedata/connectors/connectors/n8n.py +141 -0
- recurvedata/connectors/connectors/oss.py +74 -0
- recurvedata/connectors/connectors/owncloud.py +36 -0
- recurvedata/connectors/connectors/phoenix.py +36 -0
- recurvedata/connectors/connectors/postgres.py +230 -0
- recurvedata/connectors/connectors/python.py +50 -0
- recurvedata/connectors/connectors/redshift.py +187 -0
- recurvedata/connectors/connectors/s3.py +93 -0
- recurvedata/connectors/connectors/sftp.py +87 -0
- recurvedata/connectors/connectors/slack.py +35 -0
- recurvedata/connectors/connectors/spark.py +99 -0
- recurvedata/connectors/connectors/starrocks.py +175 -0
- recurvedata/connectors/connectors/tencent_cos.py +40 -0
- recurvedata/connectors/connectors/tidb.py +49 -0
- recurvedata/connectors/const.py +315 -0
- recurvedata/connectors/datasource.py +189 -0
- recurvedata/connectors/dbapi.py +469 -0
- recurvedata/connectors/fs.py +66 -0
- recurvedata/connectors/ftp.py +40 -0
- recurvedata/connectors/object_store.py +60 -0
- recurvedata/connectors/pigeon.py +172 -0
- recurvedata/connectors/proxy.py +104 -0
- recurvedata/connectors/service.py +223 -0
- recurvedata/connectors/utils.py +47 -0
- recurvedata/consts.py +49 -0
- recurvedata/core/__init__.py +0 -0
- recurvedata/core/config.py +46 -0
- recurvedata/core/configurable.py +27 -0
- recurvedata/core/consts.py +2 -0
- recurvedata/core/templating.py +206 -0
- recurvedata/core/tracing.py +223 -0
- recurvedata/core/transformer.py +186 -0
- recurvedata/core/translation.py +91 -0
- recurvedata/dbt/client.py +97 -0
- recurvedata/dbt/consts.py +99 -0
- recurvedata/dbt/cosmos_utils.py +275 -0
- recurvedata/dbt/error_codes.py +18 -0
- recurvedata/dbt/schemas.py +98 -0
- recurvedata/dbt/service.py +451 -0
- recurvedata/dbt/utils.py +246 -0
- recurvedata/error_codes.py +71 -0
- recurvedata/exceptions.py +72 -0
- recurvedata/executors/__init__.py +4 -0
- recurvedata/executors/cli/__init__.py +7 -0
- recurvedata/executors/cli/connector.py +117 -0
- recurvedata/executors/cli/dbt.py +118 -0
- recurvedata/executors/cli/main.py +82 -0
- recurvedata/executors/cli/parameters.py +18 -0
- recurvedata/executors/client.py +190 -0
- recurvedata/executors/consts.py +50 -0
- recurvedata/executors/debug_executor.py +100 -0
- recurvedata/executors/executor.py +300 -0
- recurvedata/executors/link_executor.py +189 -0
- recurvedata/executors/models.py +34 -0
- recurvedata/executors/schemas.py +222 -0
- recurvedata/executors/service/__init__.py +0 -0
- recurvedata/executors/service/connector.py +380 -0
- recurvedata/executors/utils.py +172 -0
- recurvedata/filestorage/__init__.py +11 -0
- recurvedata/filestorage/_factory.py +33 -0
- recurvedata/filestorage/backends/__init__.py +0 -0
- recurvedata/filestorage/backends/fsspec.py +45 -0
- recurvedata/filestorage/backends/local.py +67 -0
- recurvedata/filestorage/backends/oss.py +56 -0
- recurvedata/filestorage/interface.py +84 -0
- recurvedata/operators/__init__.py +10 -0
- recurvedata/operators/base.py +28 -0
- recurvedata/operators/config.py +21 -0
- recurvedata/operators/context.py +255 -0
- recurvedata/operators/dbt_operator/__init__.py +2 -0
- recurvedata/operators/dbt_operator/model_pipeline_link_operator.py +55 -0
- recurvedata/operators/dbt_operator/operator.py +353 -0
- recurvedata/operators/link_operator/__init__.py +1 -0
- recurvedata/operators/link_operator/operator.py +120 -0
- recurvedata/operators/models.py +55 -0
- recurvedata/operators/notify_operator/__init__.py +1 -0
- recurvedata/operators/notify_operator/operator.py +180 -0
- recurvedata/operators/operator.py +119 -0
- recurvedata/operators/python_operator/__init__.py +1 -0
- recurvedata/operators/python_operator/operator.py +132 -0
- recurvedata/operators/sensor_operator/__init__.py +1 -0
- recurvedata/operators/sensor_operator/airflow_utils.py +63 -0
- recurvedata/operators/sensor_operator/operator.py +172 -0
- recurvedata/operators/spark_operator/__init__.py +1 -0
- recurvedata/operators/spark_operator/operator.py +200 -0
- recurvedata/operators/spark_operator/spark_sample.py +47 -0
- recurvedata/operators/sql_operator/__init__.py +1 -0
- recurvedata/operators/sql_operator/operator.py +90 -0
- recurvedata/operators/task.py +211 -0
- recurvedata/operators/transfer_operator/__init__.py +40 -0
- recurvedata/operators/transfer_operator/const.py +10 -0
- recurvedata/operators/transfer_operator/dump_aliyun_sls.py +82 -0
- recurvedata/operators/transfer_operator/dump_sheet_task_base.py +292 -0
- recurvedata/operators/transfer_operator/dump_task_cass.py +155 -0
- recurvedata/operators/transfer_operator/dump_task_dbapi.py +209 -0
- recurvedata/operators/transfer_operator/dump_task_es.py +113 -0
- recurvedata/operators/transfer_operator/dump_task_feishu_sheet.py +114 -0
- recurvedata/operators/transfer_operator/dump_task_ftp.py +234 -0
- recurvedata/operators/transfer_operator/dump_task_google_sheet.py +66 -0
- recurvedata/operators/transfer_operator/dump_task_mongodb.py +168 -0
- recurvedata/operators/transfer_operator/dump_task_oss.py +285 -0
- recurvedata/operators/transfer_operator/dump_task_python.py +212 -0
- recurvedata/operators/transfer_operator/dump_task_s3.py +270 -0
- recurvedata/operators/transfer_operator/dump_task_sftp.py +229 -0
- recurvedata/operators/transfer_operator/load_task_aliyun_oss.py +107 -0
- recurvedata/operators/transfer_operator/load_task_azure_blob.py +115 -0
- recurvedata/operators/transfer_operator/load_task_azure_synapse.py +90 -0
- recurvedata/operators/transfer_operator/load_task_clickhouse.py +167 -0
- recurvedata/operators/transfer_operator/load_task_doris.py +164 -0
- recurvedata/operators/transfer_operator/load_task_email.py +188 -0
- recurvedata/operators/transfer_operator/load_task_es.py +86 -0
- recurvedata/operators/transfer_operator/load_task_filebrowser.py +151 -0
- recurvedata/operators/transfer_operator/load_task_ftp.py +19 -0
- recurvedata/operators/transfer_operator/load_task_google_bigquery.py +90 -0
- recurvedata/operators/transfer_operator/load_task_google_cloud_storage.py +127 -0
- recurvedata/operators/transfer_operator/load_task_google_sheet.py +130 -0
- recurvedata/operators/transfer_operator/load_task_hive.py +158 -0
- recurvedata/operators/transfer_operator/load_task_microsoft_fabric.py +105 -0
- recurvedata/operators/transfer_operator/load_task_mssql.py +153 -0
- recurvedata/operators/transfer_operator/load_task_mysql.py +157 -0
- recurvedata/operators/transfer_operator/load_task_owncloud.py +135 -0
- recurvedata/operators/transfer_operator/load_task_postgresql.py +109 -0
- recurvedata/operators/transfer_operator/load_task_qcloud_cos.py +119 -0
- recurvedata/operators/transfer_operator/load_task_recurve_data_prep.py +75 -0
- recurvedata/operators/transfer_operator/load_task_redshift.py +95 -0
- recurvedata/operators/transfer_operator/load_task_s3.py +150 -0
- recurvedata/operators/transfer_operator/load_task_sftp.py +90 -0
- recurvedata/operators/transfer_operator/load_task_starrocks.py +169 -0
- recurvedata/operators/transfer_operator/load_task_yicrowds.py +97 -0
- recurvedata/operators/transfer_operator/mixin.py +31 -0
- recurvedata/operators/transfer_operator/operator.py +231 -0
- recurvedata/operators/transfer_operator/task.py +223 -0
- recurvedata/operators/transfer_operator/utils.py +134 -0
- recurvedata/operators/ui.py +80 -0
- recurvedata/operators/utils/__init__.py +51 -0
- recurvedata/operators/utils/file_factory.py +150 -0
- recurvedata/operators/utils/fs.py +10 -0
- recurvedata/operators/utils/lineage.py +265 -0
- recurvedata/operators/web_init.py +15 -0
- recurvedata/pigeon/connector/__init__.py +294 -0
- recurvedata/pigeon/connector/_registry.py +17 -0
- recurvedata/pigeon/connector/aliyun_oss.py +80 -0
- recurvedata/pigeon/connector/awss3.py +123 -0
- recurvedata/pigeon/connector/azure_blob.py +176 -0
- recurvedata/pigeon/connector/azure_synapse.py +51 -0
- recurvedata/pigeon/connector/cass.py +151 -0
- recurvedata/pigeon/connector/clickhouse.py +403 -0
- recurvedata/pigeon/connector/clickhouse_native.py +351 -0
- recurvedata/pigeon/connector/dbapi.py +571 -0
- recurvedata/pigeon/connector/doris.py +166 -0
- recurvedata/pigeon/connector/es.py +176 -0
- recurvedata/pigeon/connector/feishu.py +1135 -0
- recurvedata/pigeon/connector/ftp.py +163 -0
- recurvedata/pigeon/connector/google_bigquery.py +283 -0
- recurvedata/pigeon/connector/google_cloud_storage.py +130 -0
- recurvedata/pigeon/connector/hbase_phoenix.py +108 -0
- recurvedata/pigeon/connector/hdfs.py +204 -0
- recurvedata/pigeon/connector/hive_impala.py +383 -0
- recurvedata/pigeon/connector/microsoft_fabric.py +95 -0
- recurvedata/pigeon/connector/mongodb.py +56 -0
- recurvedata/pigeon/connector/mssql.py +467 -0
- recurvedata/pigeon/connector/mysql.py +175 -0
- recurvedata/pigeon/connector/owncloud.py +92 -0
- recurvedata/pigeon/connector/postgresql.py +267 -0
- recurvedata/pigeon/connector/power_bi.py +179 -0
- recurvedata/pigeon/connector/qcloud_cos.py +79 -0
- recurvedata/pigeon/connector/redshift.py +123 -0
- recurvedata/pigeon/connector/sftp.py +73 -0
- recurvedata/pigeon/connector/sqlite.py +42 -0
- recurvedata/pigeon/connector/starrocks.py +144 -0
- recurvedata/pigeon/connector/tableau.py +162 -0
- recurvedata/pigeon/const.py +21 -0
- recurvedata/pigeon/csv.py +172 -0
- recurvedata/pigeon/docs/datasources-example.json +82 -0
- recurvedata/pigeon/docs/images/pigeon_design.png +0 -0
- recurvedata/pigeon/docs/lightweight-data-sync-solution.md +111 -0
- recurvedata/pigeon/dumper/__init__.py +171 -0
- recurvedata/pigeon/dumper/aliyun_sls.py +415 -0
- recurvedata/pigeon/dumper/base.py +141 -0
- recurvedata/pigeon/dumper/cass.py +213 -0
- recurvedata/pigeon/dumper/dbapi.py +346 -0
- recurvedata/pigeon/dumper/es.py +112 -0
- recurvedata/pigeon/dumper/ftp.py +64 -0
- recurvedata/pigeon/dumper/mongodb.py +103 -0
- recurvedata/pigeon/handler/__init__.py +4 -0
- recurvedata/pigeon/handler/base.py +153 -0
- recurvedata/pigeon/handler/csv_handler.py +290 -0
- recurvedata/pigeon/loader/__init__.py +87 -0
- recurvedata/pigeon/loader/base.py +83 -0
- recurvedata/pigeon/loader/csv_to_azure_synapse.py +214 -0
- recurvedata/pigeon/loader/csv_to_clickhouse.py +152 -0
- recurvedata/pigeon/loader/csv_to_doris.py +215 -0
- recurvedata/pigeon/loader/csv_to_es.py +51 -0
- recurvedata/pigeon/loader/csv_to_google_bigquery.py +169 -0
- recurvedata/pigeon/loader/csv_to_hive.py +468 -0
- recurvedata/pigeon/loader/csv_to_microsoft_fabric.py +242 -0
- recurvedata/pigeon/loader/csv_to_mssql.py +174 -0
- recurvedata/pigeon/loader/csv_to_mysql.py +180 -0
- recurvedata/pigeon/loader/csv_to_postgresql.py +248 -0
- recurvedata/pigeon/loader/csv_to_redshift.py +240 -0
- recurvedata/pigeon/loader/csv_to_starrocks.py +233 -0
- recurvedata/pigeon/meta.py +116 -0
- recurvedata/pigeon/row_factory.py +42 -0
- recurvedata/pigeon/schema/__init__.py +124 -0
- recurvedata/pigeon/schema/types.py +13 -0
- recurvedata/pigeon/sync.py +283 -0
- recurvedata/pigeon/transformer.py +146 -0
- recurvedata/pigeon/utils/__init__.py +134 -0
- recurvedata/pigeon/utils/bloomfilter.py +181 -0
- recurvedata/pigeon/utils/date_time.py +323 -0
- recurvedata/pigeon/utils/escape.py +15 -0
- recurvedata/pigeon/utils/fs.py +266 -0
- recurvedata/pigeon/utils/json.py +44 -0
- recurvedata/pigeon/utils/keyed_tuple.py +85 -0
- recurvedata/pigeon/utils/mp.py +156 -0
- recurvedata/pigeon/utils/sql.py +328 -0
- recurvedata/pigeon/utils/timing.py +155 -0
- recurvedata/provider_manager.py +0 -0
- recurvedata/providers/__init__.py +0 -0
- recurvedata/providers/dbapi/__init__.py +0 -0
- recurvedata/providers/flywheel/__init__.py +0 -0
- recurvedata/providers/mysql/__init__.py +0 -0
- recurvedata/schedulers/__init__.py +1 -0
- recurvedata/schedulers/airflow.py +974 -0
- recurvedata/schedulers/airflow_db_process.py +331 -0
- recurvedata/schedulers/airflow_operators.py +61 -0
- recurvedata/schedulers/airflow_plugin.py +9 -0
- recurvedata/schedulers/airflow_trigger_dag_patch.py +117 -0
- recurvedata/schedulers/base.py +99 -0
- recurvedata/schedulers/cli.py +228 -0
- recurvedata/schedulers/client.py +56 -0
- recurvedata/schedulers/consts.py +52 -0
- recurvedata/schedulers/debug_celery.py +62 -0
- recurvedata/schedulers/model.py +63 -0
- recurvedata/schedulers/schemas.py +97 -0
- recurvedata/schedulers/service.py +20 -0
- recurvedata/schedulers/system_dags.py +59 -0
- recurvedata/schedulers/task_status.py +279 -0
- recurvedata/schedulers/utils.py +73 -0
- recurvedata/schema/__init__.py +0 -0
- recurvedata/schema/field.py +88 -0
- recurvedata/schema/schema.py +55 -0
- recurvedata/schema/types.py +17 -0
- recurvedata/schema.py +0 -0
- recurvedata/server/__init__.py +0 -0
- recurvedata/server/app.py +7 -0
- recurvedata/server/connector/__init__.py +0 -0
- recurvedata/server/connector/api.py +79 -0
- recurvedata/server/connector/schemas.py +28 -0
- recurvedata/server/data_service/__init__.py +0 -0
- recurvedata/server/data_service/api.py +126 -0
- recurvedata/server/data_service/client.py +18 -0
- recurvedata/server/data_service/consts.py +1 -0
- recurvedata/server/data_service/schemas.py +68 -0
- recurvedata/server/data_service/service.py +218 -0
- recurvedata/server/dbt/__init__.py +0 -0
- recurvedata/server/dbt/api.py +116 -0
- recurvedata/server/error_code.py +49 -0
- recurvedata/server/exceptions.py +19 -0
- recurvedata/server/executor/__init__.py +0 -0
- recurvedata/server/executor/api.py +37 -0
- recurvedata/server/executor/schemas.py +30 -0
- recurvedata/server/executor/service.py +220 -0
- recurvedata/server/main.py +32 -0
- recurvedata/server/schedulers/__init__.py +0 -0
- recurvedata/server/schedulers/api.py +252 -0
- recurvedata/server/schedulers/schemas.py +50 -0
- recurvedata/server/schemas.py +50 -0
- recurvedata/utils/__init__.py +15 -0
- recurvedata/utils/_typer.py +61 -0
- recurvedata/utils/attrdict.py +19 -0
- recurvedata/utils/command_helper.py +20 -0
- recurvedata/utils/compat.py +12 -0
- recurvedata/utils/compression.py +203 -0
- recurvedata/utils/crontab.py +42 -0
- recurvedata/utils/crypto_util.py +305 -0
- recurvedata/utils/dataclass.py +11 -0
- recurvedata/utils/date_time.py +464 -0
- recurvedata/utils/dispatch.py +114 -0
- recurvedata/utils/email_util.py +104 -0
- recurvedata/utils/files.py +386 -0
- recurvedata/utils/helpers.py +170 -0
- recurvedata/utils/httputil.py +117 -0
- recurvedata/utils/imports.py +132 -0
- recurvedata/utils/json.py +80 -0
- recurvedata/utils/log.py +117 -0
- recurvedata/utils/log_capture.py +153 -0
- recurvedata/utils/mp.py +178 -0
- recurvedata/utils/normalizer.py +102 -0
- recurvedata/utils/redis_lock.py +474 -0
- recurvedata/utils/registry.py +54 -0
- recurvedata/utils/shell.py +15 -0
- recurvedata/utils/singleton.py +33 -0
- recurvedata/utils/sql.py +6 -0
- recurvedata/utils/timeout.py +28 -0
- recurvedata/utils/tracing.py +14 -0
- recurvedata_lib-0.1.487.dist-info/METADATA +605 -0
- recurvedata_lib-0.1.487.dist-info/RECORD +333 -0
- recurvedata_lib-0.1.487.dist-info/WHEEL +5 -0
- recurvedata_lib-0.1.487.dist-info/entry_points.txt +6 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from recurvedata.connectors._register import register_connector_class
|
|
2
|
+
from recurvedata.connectors.base import RecurveConnectorBase
|
|
3
|
+
from recurvedata.consts import ConnectorGroup
|
|
4
|
+
from recurvedata.core.translation import _l
|
|
5
|
+
|
|
6
|
+
CONNECTION_TYPE = "slack"
|
|
7
|
+
UI_CONNECTION_TYPE = "Slack"
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@register_connector_class([CONNECTION_TYPE, UI_CONNECTION_TYPE])
|
|
11
|
+
class FeiShuBot(RecurveConnectorBase):
|
|
12
|
+
connection_type = CONNECTION_TYPE
|
|
13
|
+
ui_connection_type = UI_CONNECTION_TYPE
|
|
14
|
+
group = [ConnectorGroup.INTEGRATION]
|
|
15
|
+
|
|
16
|
+
config_schema = {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"properties": {
|
|
19
|
+
"app_token": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"title": _l("Slack App Token"),
|
|
22
|
+
"description": _l("The token used to authenticate with Slack API"),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
"required": [
|
|
26
|
+
"app_token",
|
|
27
|
+
],
|
|
28
|
+
"secret": [
|
|
29
|
+
"app_token",
|
|
30
|
+
],
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def app_token(self):
|
|
35
|
+
return self.conf["app_token"]
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
from recurvedata.connectors._register import register_connector_class
|
|
4
|
+
from recurvedata.connectors.base import RecurveConnectorBase
|
|
5
|
+
from recurvedata.consts import ConnectionCategory, ConnectorGroup
|
|
6
|
+
from recurvedata.core.translation import _l
|
|
7
|
+
|
|
8
|
+
CONNECTION_TYPE = "spark"
|
|
9
|
+
UI_CONNECTION_TYPE = "Spark"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@register_connector_class([CONNECTION_TYPE, UI_CONNECTION_TYPE])
|
|
13
|
+
class SparkSubmit(RecurveConnectorBase):
|
|
14
|
+
connection_type = CONNECTION_TYPE
|
|
15
|
+
ui_connection_type = UI_CONNECTION_TYPE
|
|
16
|
+
category = [
|
|
17
|
+
ConnectionCategory.DATABASE,
|
|
18
|
+
]
|
|
19
|
+
group = [ConnectorGroup.DESTINATION]
|
|
20
|
+
|
|
21
|
+
config_schema = {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"properties": {
|
|
24
|
+
"submitter": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"title": _l("Spark Submit Command"),
|
|
27
|
+
"description": _l("Path to spark-submit executable"),
|
|
28
|
+
"default": "spark-submit",
|
|
29
|
+
},
|
|
30
|
+
"env": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"title": _l("Environment Variables"),
|
|
33
|
+
"description": _l("Environment variables required for Spark execution"),
|
|
34
|
+
"properties": {
|
|
35
|
+
"JAVA_HOME": {"type": "string", "title": "JAVA_HOME"},
|
|
36
|
+
"PYSPARK_PYTHON": {"type": "string", "title": "PYSPARK_PYTHON"},
|
|
37
|
+
"PYSPARK_DRIVER_PYTHON": {"type": "string", "title": "PYSPARK_DRIVER_PYTHON"},
|
|
38
|
+
"HADOOP_USER_NAME": {"type": "string", "title": "HADOOP_USER_NAME"},
|
|
39
|
+
"PIGEON_SECRET_KEY": {"type": "string", "title": "PIGEON_SECRET_KEY"},
|
|
40
|
+
"PATH": {"type": "string", "title": "PATH"},
|
|
41
|
+
"SPARK_CONF_DIR": {"type": "string", "title": "SPARK_CONF_DIR"},
|
|
42
|
+
"HADOOP_CONF_DIR": {"type": "string", "title": "HADOOP_CONF_DIR"},
|
|
43
|
+
"HIVE_CONF_DIR": {"type": "string", "title": "HIVE_CONF_DIR"},
|
|
44
|
+
"HIVE_HOME": {"type": "string", "title": "HIVE_HOME"},
|
|
45
|
+
},
|
|
46
|
+
"order": [
|
|
47
|
+
"JAVA_HOME",
|
|
48
|
+
"PYSPARK_PYTHON",
|
|
49
|
+
"PYSPARK_DRIVER_PYTHON",
|
|
50
|
+
"HADOOP_USER_NAME",
|
|
51
|
+
"PIGEON_SECRET_KEY",
|
|
52
|
+
"PATH",
|
|
53
|
+
"HIVE_CONF_DIR",
|
|
54
|
+
"HADOOP_CONF_DIR",
|
|
55
|
+
"SPARK_CONF_DIR",
|
|
56
|
+
"HIVE_HOME",
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
"execution_config": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"title": _l("Execution Configuration"),
|
|
62
|
+
"description": _l("Spark execution settings"),
|
|
63
|
+
"properties": {
|
|
64
|
+
"queue": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"title": _l("Queue Name"),
|
|
67
|
+
"description": _l("Name of the queue to submit Spark job"),
|
|
68
|
+
"default": "recurve",
|
|
69
|
+
},
|
|
70
|
+
"conf": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"title": _l("Additional Configuration"),
|
|
73
|
+
"description": _l("Additional Spark configuration in JSON format"),
|
|
74
|
+
"ui:options": {"type": "textarea"},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
"order": ["queue", "conf"],
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
"order": ["submitter", "env", "execution_config"],
|
|
81
|
+
"required": [
|
|
82
|
+
"submitter",
|
|
83
|
+
],
|
|
84
|
+
"secret": [],
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
def test_connection(self):
|
|
88
|
+
pass
|
|
89
|
+
|
|
90
|
+
@staticmethod
|
|
91
|
+
def preprocess_conf(data):
|
|
92
|
+
data = RecurveConnectorBase.preprocess_conf(data)
|
|
93
|
+
execution_config = data.get("execution_config")
|
|
94
|
+
if execution_config:
|
|
95
|
+
execution_config_conf = execution_config.get("conf")
|
|
96
|
+
if execution_config_conf and isinstance(execution_config_conf, str):
|
|
97
|
+
execution_config_conf = json.loads(execution_config_conf)
|
|
98
|
+
execution_config["conf"] = execution_config_conf
|
|
99
|
+
return data
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
from functools import cached_property
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
from recurvedata.connectors._register import register_connector_class
|
|
5
|
+
from recurvedata.connectors.connectors.mysql import MysqlConnector
|
|
6
|
+
from recurvedata.connectors.const import ENV_VAR_DBT_PASSWORD, ENV_VAR_DBT_USER, SSH_TUNNEL_CONFIG_SCHEMA
|
|
7
|
+
from recurvedata.connectors.datasource import DataSourceWrapper
|
|
8
|
+
from recurvedata.connectors.dbapi import DBAPIBase, with_ssh_tunnel
|
|
9
|
+
from recurvedata.consts import ConnectorGroup
|
|
10
|
+
from recurvedata.core.translation import _l
|
|
11
|
+
|
|
12
|
+
CONNECTION_TYPE = "starrocks"
|
|
13
|
+
UI_CONNECTION_TYPE = "StarRocks"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@register_connector_class([CONNECTION_TYPE, UI_CONNECTION_TYPE])
|
|
17
|
+
class StarRocksConnector(MysqlConnector):
|
|
18
|
+
SYSTEM_DATABASES = [
|
|
19
|
+
"information_schema",
|
|
20
|
+
]
|
|
21
|
+
connection_type = CONNECTION_TYPE
|
|
22
|
+
ui_connection_type = UI_CONNECTION_TYPE
|
|
23
|
+
group = [ConnectorGroup.DESTINATION]
|
|
24
|
+
|
|
25
|
+
config_schema = {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"properties": {
|
|
28
|
+
"host": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"title": _l("Host Address"),
|
|
31
|
+
"default": "127.0.0.1",
|
|
32
|
+
},
|
|
33
|
+
"user": {"type": "string", "title": _l("Username")},
|
|
34
|
+
"password": {"type": "string", "title": _l("Password")},
|
|
35
|
+
"database": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"title": _l("Database Name"),
|
|
38
|
+
"description": _l("The name of the database to connect to"),
|
|
39
|
+
},
|
|
40
|
+
"port": {
|
|
41
|
+
"type": "number",
|
|
42
|
+
"title": _l("MySQL Port Number"),
|
|
43
|
+
"description": _l("The port number for connecting to MySQL server on FE"),
|
|
44
|
+
"default": 9030,
|
|
45
|
+
},
|
|
46
|
+
"http_port": {
|
|
47
|
+
"type": "number",
|
|
48
|
+
"title": _l("FE HTTP Port"),
|
|
49
|
+
"description": _l("The HTTP port number for the Doris Frontend (FE) service"),
|
|
50
|
+
"default": 8030,
|
|
51
|
+
},
|
|
52
|
+
"ssh_tunnel": SSH_TUNNEL_CONFIG_SCHEMA,
|
|
53
|
+
},
|
|
54
|
+
"order": ["host", "port", "http_port", "user", "password", "database", "ssh_tunnel"],
|
|
55
|
+
"required": ["host", "http_port"],
|
|
56
|
+
"secret": ["password"],
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
available_column_types = DBAPIBase.available_column_types + [
|
|
60
|
+
# Numeric types
|
|
61
|
+
"tinyint",
|
|
62
|
+
"integer", # alias for int
|
|
63
|
+
"largeint", # 128-bit signed integer
|
|
64
|
+
"numeric", # alias for decimal
|
|
65
|
+
"real", # alias for float
|
|
66
|
+
"double precision", # alias for double
|
|
67
|
+
# String types
|
|
68
|
+
"text", # alias for string
|
|
69
|
+
"string", # alias for varchar
|
|
70
|
+
"binary",
|
|
71
|
+
"varbinary",
|
|
72
|
+
# Date and Time types
|
|
73
|
+
"datetime", # alias for timestamp
|
|
74
|
+
"time",
|
|
75
|
+
# Complex types
|
|
76
|
+
"array",
|
|
77
|
+
"map",
|
|
78
|
+
"struct",
|
|
79
|
+
"json",
|
|
80
|
+
# Special types
|
|
81
|
+
"bitmap",
|
|
82
|
+
"hll",
|
|
83
|
+
# Boolean type
|
|
84
|
+
"boolean",
|
|
85
|
+
"bool", # alias for boolean
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
column_type_mapping = {
|
|
89
|
+
"integer": ["tinyint", "largeint"],
|
|
90
|
+
"string": ["text", "string"],
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
def convert_config_to_dbt_profile(self, database: str, schema: str = None) -> dict:
|
|
94
|
+
return {
|
|
95
|
+
"host": self.host,
|
|
96
|
+
"port": self.port,
|
|
97
|
+
"username": ENV_VAR_DBT_USER,
|
|
98
|
+
"password": ENV_VAR_DBT_PASSWORD,
|
|
99
|
+
"schema": database or self.database,
|
|
100
|
+
"type": "starrocks", # dbt-starrocks only support python<=3.10
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
def convert_config_to_cube_config(
|
|
104
|
+
self, database: str, schema: str = None, datasource: DataSourceWrapper = None
|
|
105
|
+
) -> dict:
|
|
106
|
+
return {
|
|
107
|
+
"type": "mysql",
|
|
108
|
+
"host": self.host,
|
|
109
|
+
"port": self.port,
|
|
110
|
+
"user": datasource.user,
|
|
111
|
+
"password": datasource.password,
|
|
112
|
+
"database": database or self.database,
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@with_ssh_tunnel
|
|
116
|
+
def get_columns(self, table, database=None):
|
|
117
|
+
"""
|
|
118
|
+
Override get_columns method to properly handle StarRocks-specific data types
|
|
119
|
+
"""
|
|
120
|
+
database = database or self.database
|
|
121
|
+
# Use raw SQL query to get column information instead of relying on SQLAlchemy inspector
|
|
122
|
+
query = f"""
|
|
123
|
+
SELECT
|
|
124
|
+
column_name,
|
|
125
|
+
data_type,
|
|
126
|
+
column_default,
|
|
127
|
+
is_nullable,
|
|
128
|
+
column_comment
|
|
129
|
+
FROM information_schema.columns
|
|
130
|
+
WHERE table_schema = '{database}'
|
|
131
|
+
AND table_name = '{table}'
|
|
132
|
+
"""
|
|
133
|
+
column_metas = []
|
|
134
|
+
results = self.fetchall(query)
|
|
135
|
+
for row in results:
|
|
136
|
+
column_metas.append(
|
|
137
|
+
{
|
|
138
|
+
"name": row[0],
|
|
139
|
+
"type": row[1].lower() if row[1] else "",
|
|
140
|
+
"default": row[2],
|
|
141
|
+
"nullable": row[3] == "YES",
|
|
142
|
+
"comment": row[4],
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
return column_metas
|
|
147
|
+
|
|
148
|
+
@cached_property
|
|
149
|
+
@with_ssh_tunnel
|
|
150
|
+
def type_code_mapping(self) -> dict:
|
|
151
|
+
pass
|
|
152
|
+
|
|
153
|
+
def sqlalchemy_column_type_code_to_name(self, type_code: Any, size: int | None = None) -> str:
|
|
154
|
+
# values refer to https://docs.starrocks.io/docs/sql-reference/data-types/
|
|
155
|
+
# values of this mapping must be in available_column_types, or just default as string
|
|
156
|
+
from pymysql.constants import FIELD_TYPE
|
|
157
|
+
|
|
158
|
+
type_code_mapping = {
|
|
159
|
+
FIELD_TYPE.TINY: "tinyint",
|
|
160
|
+
FIELD_TYPE.SHORT: "smallint",
|
|
161
|
+
FIELD_TYPE.LONG: "int",
|
|
162
|
+
FIELD_TYPE.FLOAT: "float",
|
|
163
|
+
FIELD_TYPE.DOUBLE: "double",
|
|
164
|
+
FIELD_TYPE.DECIMAL: "decimal",
|
|
165
|
+
FIELD_TYPE.NEWDECIMAL: "decimal",
|
|
166
|
+
FIELD_TYPE.LONGLONG: "bigint",
|
|
167
|
+
FIELD_TYPE.INT24: "int",
|
|
168
|
+
FIELD_TYPE.DATE: "date",
|
|
169
|
+
FIELD_TYPE.NEWDATE: "date",
|
|
170
|
+
FIELD_TYPE.DATETIME: "datetime",
|
|
171
|
+
FIELD_TYPE.STRING: "varchar",
|
|
172
|
+
FIELD_TYPE.VARCHAR: "varchar",
|
|
173
|
+
FIELD_TYPE.JSON: "json",
|
|
174
|
+
}
|
|
175
|
+
return type_code_mapping.get(type_code, "string")
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from recurvedata.connectors._register import register_connector_class
|
|
2
|
+
from recurvedata.connectors.object_store import ObjectStoreMixin
|
|
3
|
+
from recurvedata.consts import ConnectorGroup
|
|
4
|
+
from recurvedata.core.translation import _l
|
|
5
|
+
|
|
6
|
+
CONNECTION_TYPE = "cos"
|
|
7
|
+
UI_CONNECTION_TYPE = "Tencent COS"
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@register_connector_class([CONNECTION_TYPE, UI_CONNECTION_TYPE])
|
|
11
|
+
class COS(ObjectStoreMixin):
|
|
12
|
+
connection_type = CONNECTION_TYPE
|
|
13
|
+
ui_connection_type = UI_CONNECTION_TYPE
|
|
14
|
+
group = [ConnectorGroup.DESTINATION]
|
|
15
|
+
setup_extras_require = []
|
|
16
|
+
|
|
17
|
+
config_schema = {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"properties": {
|
|
20
|
+
"secret_id": {"type": "string", "title": _l("Tencent Cloud API Secret ID")},
|
|
21
|
+
"secret_key": {"type": "string", "title": _l("Tencent Cloud API Secret Key")},
|
|
22
|
+
"region": {"type": "string", "title": _l("COS Region"), "default": "ap-guangzhou"},
|
|
23
|
+
"bucket": {"type": "string", "title": _l("Bucket Name")},
|
|
24
|
+
},
|
|
25
|
+
"order": ["secret_id", "secret_key", "region", "bucket"],
|
|
26
|
+
"required": ["secret_id", "secret_key", "region", "bucket"],
|
|
27
|
+
"secret": ["secret_key"],
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
def init_connection(self, conf):
|
|
31
|
+
self.connector = None # todo
|
|
32
|
+
|
|
33
|
+
def test_connection(self):
|
|
34
|
+
# todo
|
|
35
|
+
pass
|
|
36
|
+
|
|
37
|
+
juice_sync_able = True
|
|
38
|
+
|
|
39
|
+
def juice_sync_path(self, path: str) -> str:
|
|
40
|
+
return f"cos://{path}" # todo
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from recurvedata.connectors._register import register_connector_class
|
|
2
|
+
from recurvedata.connectors.dbapi import DBAPIBase, with_ssh_tunnel
|
|
3
|
+
from recurvedata.consts import ConnectorGroup
|
|
4
|
+
from recurvedata.core.translation import _l
|
|
5
|
+
|
|
6
|
+
CONNECTION_TYPE = "tidb"
|
|
7
|
+
UI_CONNECTION_TYPE = "TiDB"
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@register_connector_class([CONNECTION_TYPE, UI_CONNECTION_TYPE])
|
|
11
|
+
class TidbConnector(DBAPIBase):
|
|
12
|
+
SYSTEM_DATABASES = ["information_schema", "mysql", "performance_schema", "sys"]
|
|
13
|
+
connection_type = CONNECTION_TYPE
|
|
14
|
+
ui_connection_type = UI_CONNECTION_TYPE
|
|
15
|
+
group = [ConnectorGroup.DESTINATION]
|
|
16
|
+
setup_extras_require = ["mysql-connector-python"]
|
|
17
|
+
# pip install git+https://github.com/pingcap/sqlalchemy-tidb.git@main
|
|
18
|
+
# manually run setup.py and upload to Recurvedata pypi
|
|
19
|
+
|
|
20
|
+
driver = "mysql+mysqlconnector"
|
|
21
|
+
config_schema = {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"properties": {
|
|
24
|
+
"host": {"type": "string", "title": _l("Host Address"), "default": "127.0.0.1"},
|
|
25
|
+
"port": {
|
|
26
|
+
"type": "number",
|
|
27
|
+
"title": _l("Port Number"),
|
|
28
|
+
"default": 4000,
|
|
29
|
+
},
|
|
30
|
+
"user": {"type": "string", "title": _l("Username")},
|
|
31
|
+
"password": {"type": "string", "title": _l("Password")},
|
|
32
|
+
"database": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"title": _l("Database Name"),
|
|
35
|
+
"description": _l("The name of the database to connect to"),
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
"order": ["host", "port", "user", "password", "database"],
|
|
39
|
+
"required": ["host"],
|
|
40
|
+
"secret": ["password"],
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@with_ssh_tunnel
|
|
44
|
+
def get_columns(self, table, database=None):
|
|
45
|
+
database = database or self.database
|
|
46
|
+
column_dcts = self.inspector.get_columns(table, schema=database)
|
|
47
|
+
for dct in column_dcts:
|
|
48
|
+
dct["type"] = self._extract_column_name(dct["type"]).lower()
|
|
49
|
+
return column_dcts
|