Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ingest/dremio): Dremio Source Ingestion #11598

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
38e5946
feat: Dremio Source Ingestion
sagar-salvi-apptware Oct 11, 2024
a5b8c45
refactor: improvement to metadata gathering
sagar-salvi-apptware Oct 11, 2024
4a81b19
fix: Update dremio_entity.py
sagar-salvi-apptware Oct 11, 2024
51c2443
fix: Update dremio_sql_queries.py
sagar-salvi-apptware Oct 11, 2024
84227b6
refactor: Update dremio_source.py
sagar-salvi-apptware Oct 11, 2024
e462be6
feat: Dremio Source Ingestion
sagar-salvi-apptware Oct 11, 2024
703a3f8
refactor: improvement to metadata gathering
sagar-salvi-apptware Oct 11, 2024
4283cb6
fix: Update dremio_entity.py
sagar-salvi-apptware Oct 11, 2024
f897b9e
fix: Update dremio_sql_queries.py
sagar-salvi-apptware Oct 11, 2024
ac56777
refactor: Update dremio_source.py
sagar-salvi-apptware Oct 11, 2024
3ce57b9
test: add integration test for dremio
sagar-salvi-apptware Oct 17, 2024
e1ee817
fix: added minor changes + fix testcase
sagar-salvi-apptware Oct 17, 2024
b23e003
fix: PR Comments
sagar-salvi-apptware Oct 21, 2024
7247ac1
Merge branch 'feat/dremio-connector-source' of https://github.com/sag…
acrylJonny Oct 21, 2024
b9d7b8a
switch to drill dialect
acrylJonny Oct 21, 2024
230fbd7
Merge branch 'master' into feat/dremio-connector-source
acrylJonny Oct 21, 2024
d979d31
Update dremio_entities.py
acrylJonny Oct 21, 2024
9244e4c
Update dremio_entities.py
acrylJonny Oct 21, 2024
44853b8
Update datahub-web-react/src/app/ingest/source/builder/sources.json
acrylJonny Oct 21, 2024
fac705c
Update metadata-ingestion/docs/sources/dremio/README.md
acrylJonny Oct 21, 2024
29ba440
reafactor: Dremio Authetication
sagar-salvi-apptware Oct 21, 2024
6574b63
Cite Dremio Docs for SchemaFieldTypeMapper
acrylJonny Oct 21, 2024
9835e31
test: fix ci test
sagar-salvi-apptware Oct 21, 2024
a6a9a91
fix: PR comments
sagar-salvi-apptware Oct 22, 2024
b0c8c08
fix: dataset_pattern changes for tables and views
sagar-salvi-apptware Oct 23, 2024
ff211af
add warnings when unable to parse sql query
acrylJonny Oct 23, 2024
459cfc8
add view definition aspect
acrylJonny Oct 23, 2024
224ec10
bug fix - external urls. Improve Dremio Cloud API support for projects
acrylJonny Oct 24, 2024
0982a1b
fix: ci test
sagar-salvi-apptware Oct 24, 2024
3ce5e02
docs: minor docs changes per pr comments
sagar-salvi-apptware Oct 25, 2024
9c1e3fb
fix: PR comments
sagar-salvi-apptware Oct 25, 2024
7b938b2
docs: minor changes
sagar-salvi-apptware Oct 25, 2024
6914f75
build: added dependacy for sql
sagar-salvi-apptware Oct 25, 2024
3176e71
test: fix ci test
sagar-salvi-apptware Oct 25, 2024
9c1c556
fix: add minor change in report failure
sagar-salvi-apptware Oct 25, 2024
6670a98
fix: statefull ingestion error
sagar-salvi-apptware Oct 25, 2024
3e2eae7
fix: PR Comments and added mysql as a source to test
sagar-salvi-apptware Oct 27, 2024
195f78c
fix: PR Comments
sagar-salvi-apptware Oct 28, 2024
9de8be0
test: Updated the test for platform instance
sagar-salvi-apptware Oct 28, 2024
102b55f
Merge branch 'master' into feat/dremio-connector-source
sagar-salvi-apptware Oct 28, 2024
8efa349
fix: minor comments
sagar-salvi-apptware Oct 28, 2024
82988fd
test: fix ci test
sagar-salvi-apptware Oct 28, 2024
7433b8b
fix: added fixes for dremio cloud apis
sagar-salvi-apptware Oct 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,6 @@
"displayName": "Dremio",
"description": "Import Spaces, Sources, Tables and statistics from Dremio.",
"docsUrl": "https://datahubproject.io/docs/metadata-ingestion/",
"recipe": "source:\n type: dremio\n config:\n # Coordinates\n hostname: null\n port: null\n #Credentials with personal access token\n authentication_method: PAT\n password: pass\n #Or Credentials with basic auth\n #authentication_method: password\n #username: null\n #password: null\n stateful_ingestion:\n enabled: true"
"recipe": "source:\n type: dremio\n config:\n # Coordinates\n hostname: null\n port: null\n\n #Credentials with personal access token\n authentication_method: PAT\n password: pass\n #Or Credentials with basic auth\n #authentication_method: password\n #username: null\n #password: null\n #tls: true-->https/false-->http\n\n stateful_ingestion:\n enabled: true"
sagar-salvi-apptware marked this conversation as resolved.
Show resolved Hide resolved
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ def authenticate(self, connection_args: "DremioSourceConfig") -> None:
self.report.failure("Failed to authenticate", str(e))
sleep(1) # Optional: exponential backoff

self.report.failure(
"Credentials cannot be refreshed. Please check your username and password."
)
raise DremioAPIException(
"Credentials cannot be refreshed. Please check your username and password."
)
Expand Down Expand Up @@ -263,9 +266,15 @@ def execute_query(self, query: str, timeout: int = 300) -> List[Dict[str, Any]]:
return future.result(timeout=timeout)
except concurrent.futures.TimeoutError:
self.cancel_query(job_id)
self.report.failure(
f"Query execution timed out after {timeout} seconds"
)
raise TimeoutError(
f"Query execution timed out after {timeout} seconds"
)
except RuntimeError as e:
self.report.failure("Query Execution failed", exc=e)
raise DremioAPIException("Query Execution failed: {str(e)}")

except requests.RequestException as e:
raise DremioAPIException(f"Error executing query: {str(e)}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
PlatformInstanceConfigMixin,
)
from datahub.ingestion.source.ge_profiling_config import GEProfilingConfig
from datahub.ingestion.source.state.stale_entity_removal_handler import (
StatefulStaleMetadataRemovalConfig,
)
from datahub.ingestion.source.state.stateful_ingestion_base import (
StatefulIngestionConfigBase,
)
Expand Down Expand Up @@ -152,6 +155,8 @@ class DremioSourceConfig(
default=BaseUsageConfig(),
)

stateful_ingestion: Optional[StatefulStaleMetadataRemovalConfig] = None

# Profiling
profile_pattern: AllowDenyPattern = Field(
default=AllowDenyPattern.allow_all(),
Expand All @@ -172,13 +177,3 @@ class DremioSourceConfig(
default=False,
description="Whether to include query-based lineage information.",
)

include_table_rename_lineage: bool = Field(
default=True,
description="Whether to include table rename lineage",
)

include_copy_lineage: bool = Field(
default=True,
description="Whether to include copy lineage",
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import re
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor, as_completed
from typing import Any, Dict, Iterable, List, Optional
from typing import Dict, Iterable, List, Optional

from datahub.emitter.mce_builder import (
make_data_platform_urn,
make_dataset_urn_with_platform_instance,
)
from datahub.emitter.mcp import MetadataChangeProposalWrapper
from datahub.ingestion.api.common import PipelineContext
from datahub.ingestion.api.decorators import (
SupportStatus,
capability,
Expand Down Expand Up @@ -105,7 +106,7 @@ class DremioSource(StatefulIngestionSourceBase):
config: DremioSourceConfig
report: DremioSourceReport

def __init__(self, config: DremioSourceConfig, ctx: Any):
def __init__(self, config: DremioSourceConfig, ctx: PipelineContext):
super().__init__(config, ctx)
self.default_db = "dremio"
self.config = config
Expand Down Expand Up @@ -145,7 +146,7 @@ def __init__(self, config: DremioSourceConfig, ctx: Any):
)

@classmethod
def create(cls, config_dict: Dict[str, Any], ctx: Any) -> "DremioSource":
def create(cls, config_dict: Dict, ctx: PipelineContext) -> "DremioSource":
config = DremioSourceConfig.parse_obj(config_dict)
return cls(config, ctx)

Expand Down Expand Up @@ -599,9 +600,3 @@ def get_report(self) -> SourceReport:
Get the source report.
"""
return self.report

def close(self) -> None:
"""
Close any resources held by the source.
"""
pass
23 changes: 22 additions & 1 deletion metadata-ingestion/tests/integration/dremio/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,40 @@ services:
- 9001:9001
- 9000:9000
command: ["server", "/data", "--console-address", ":9001"]

#MySql
mysqldb:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: rootpwd123
MYSQL_USER: foo
MYSQL_PASSWORD: datahub123
container_name: test_mysql
hostname: test_mysql
ports:
- "23306:3306"
volumes:
- ./setup/mysqld.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf
- ./setup/setup.sql:/docker-entrypoint-initdb.d/setup.sql
networks:
dremio-network:

# Dremio
dremio:
platform: linux/x86_64
image: dremio/dremio-oss:latest
container_name: dremio
ports:
- 9047:9047
- 31010:31010
- 32010:32010
container_name: dremio
environment:
- DREMIO_JAVA_SERVER_EXTRA_OPTS=-Dpaths.dist=file:///opt/dremio/data/dist
networks:
dremio-network:
depends_on:
- minio
- mysqldb

networks:
dremio-network:
Loading
Loading