Skip to content

Commit

Permalink
Merge branch 'datahub-project:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
anshbansal authored Aug 1, 2023
2 parents 6ae61ba + 2e2a674 commit eb33e88
Show file tree
Hide file tree
Showing 38 changed files with 55,206 additions and 656 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
timezoneLinux: ${{ matrix.timezone }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 800
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-datahub-jars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 800
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 800
- uses: actions/setup-python@v4
with:
python-version: "3.10"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-ingestion-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 800
- name: Build and Push image
uses: ./.github/actions/docker-custom-build-and-push
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-ingestion-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 800
- name: Build and push
uses: ./.github/actions/docker-custom-build-and-push
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-ingestion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 800
- name: Build and push
uses: ./.github/actions/docker-custom-build-and-push
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-postgres-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 800
- name: Build and push
uses: ./.github/actions/docker-custom-build-and-push
with:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/docker-unified.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 800
- name: Pre-build artifacts for docker image
run: |
./gradlew :metadata-service:war:build -x test --parallel
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 800
- name: Pre-build artifacts for docker image
run: |
./gradlew :metadata-jobs:mae-consumer-job:build -x test --parallel
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 800
- name: Pre-build artifacts for docker image
run: |
./gradlew :metadata-jobs:mce-consumer-job:build -x test --parallel
Expand Down Expand Up @@ -244,7 +244,7 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 800
- name: Pre-build artifacts for docker image
run: |
./gradlew :datahub-upgrade:build -x test --parallel
Expand Down Expand Up @@ -302,7 +302,7 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 800
- name: Pre-build artifacts for docker image
run: |
./gradlew :datahub-frontend:dist -x test -x yarnTest -x yarnLint --parallel
Expand Down Expand Up @@ -362,7 +362,7 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 800
- name: Build and push
uses: ./.github/actions/docker-custom-build-and-push
with:
Expand All @@ -384,7 +384,7 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 800
- name: Build and push
uses: ./.github/actions/docker-custom-build-and-push
with:
Expand All @@ -406,7 +406,7 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 800
- name: Build and push
uses: ./.github/actions/docker-custom-build-and-push
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-datahub-jars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 800
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ import {
PROJECT_NAME,
} from './lookml';
import { PRESTO, PRESTO_HOST_PORT, PRESTO_DATABASE, PRESTO_USERNAME, PRESTO_PASSWORD } from './presto';
import { BIGQUERY_BETA, DBT_CLOUD, MYSQL, POWER_BI, UNITY_CATALOG } from '../constants';
import { BIGQUERY_BETA, DBT_CLOUD, MYSQL, POWER_BI, UNITY_CATALOG, VERTICA } from '../constants';
import { BIGQUERY_BETA_PROJECT_ID, DATASET_ALLOW, DATASET_DENY, PROJECT_ALLOW, PROJECT_DENY } from './bigqueryBeta';
import { MYSQL_HOST_PORT, MYSQL_PASSWORD, MYSQL_USERNAME } from './mysql';
import { MSSQL, MSSQL_DATABASE, MSSQL_HOST_PORT, MSSQL_PASSWORD, MSSQL_USERNAME } from './mssql';
Expand Down Expand Up @@ -130,6 +130,17 @@ import {
WORKSPACE_ID_DENY,
} from './powerbi';

import {
VERTICA_HOST_PORT,
VERTICA_DATABASE,
VERTICA_USERNAME,
VERTICA_PASSWORD,
INCLUDE_PROJECTIONS,
INCLUDE_MLMODELS,
INCLUDE_VIEW_LINEAGE,
INCLUDE_PROJECTIONS_LINEAGE,
} from './vertica';

export enum RecipeSections {
Connection = 0,
Filter = 1,
Expand Down Expand Up @@ -428,6 +439,20 @@ export const RECIPE_FIELDS: RecipeFields = {
],
filterSectionTooltip: 'Include or exclude specific PowerBI Workspaces from ingestion.',
},
[VERTICA]: {
fields: [VERTICA_HOST_PORT, VERTICA_DATABASE, VERTICA_USERNAME, VERTICA_PASSWORD],
filterFields: [SCHEMA_ALLOW, SCHEMA_DENY, TABLE_ALLOW, TABLE_DENY, VIEW_ALLOW, VIEW_DENY],
advancedFields: [
INCLUDE_TABLES,
INCLUDE_VIEWS,
INCLUDE_PROJECTIONS,
INCLUDE_MLMODELS,
INCLUDE_VIEW_LINEAGE,
INCLUDE_PROJECTIONS_LINEAGE,
TABLE_PROFILING_ENABLED,
],
filterSectionTooltip: 'Include or exclude specific Schemas, Tables, Views and Projections from ingestion.',
},
};

export const CONNECTORS_WITH_FORM = new Set(Object.keys(RECIPE_FIELDS));
Expand Down
119 changes: 119 additions & 0 deletions datahub-web-react/src/app/ingest/source/builder/RecipeForm/vertica.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
import { get } from 'lodash';
import { RecipeField, FieldType } from './common';

export const VERTICA_HOST_PORT: RecipeField = {
name: 'host_port',
label: 'Host and Port',
tooltip:
"The host and port where Vertica is running. For example, 'localhost:5433'. Note: this host must be accessible on the network where DataHub is running (or allowed via an IP Allow List, AWS PrivateLink, etc).",
type: FieldType.TEXT,
fieldPath: 'source.config.host_port',
placeholder: 'localhost:5433',
required: true,
rules: null,
};

export const VERTICA_DATABASE: RecipeField = {
name: 'database',
label: 'Database',
tooltip: 'Ingest metadata for a specific Database.',
type: FieldType.TEXT,
fieldPath: 'source.config.database',
placeholder: 'Vertica_Database',
required: true,
rules: null,
};

export const VERTICA_USERNAME: RecipeField = {
name: 'username',
label: 'Username',
tooltip: 'The Vertica username used to extract metadata.',
type: FieldType.TEXT,
fieldPath: 'source.config.username',
placeholder: 'Vertica_Username',
required: true,
rules: null,
};

export const VERTICA_PASSWORD: RecipeField = {
name: 'password',
label: 'Password',
tooltip: 'The Vertica password for the user.',
type: FieldType.SECRET,
fieldPath: 'source.config.password',
placeholder: 'Vertica_Password',
required: true,
rules: null,
};

const includeProjectionPath = 'source.config.include_projections';
export const INCLUDE_PROJECTIONS: RecipeField = {
name: 'include_projections',
label: 'Include Projections',
tooltip: 'Extract Projections from source.',
type: FieldType.BOOLEAN,
fieldPath: includeProjectionPath,
// This is in accordance with what the ingestion sources do.
getValueFromRecipeOverride: (recipe: any) => {
const includeProjection = get(recipe, includeProjectionPath);
if (includeProjection !== undefined && includeProjection !== null) {
return includeProjection;
}
return true;
},
rules: null,
};

const includemodelsPath = 'source.config.include_models';
export const INCLUDE_MLMODELS: RecipeField = {
name: 'include_models',
label: 'Include ML Models',
tooltip: 'Extract ML models from source.',
type: FieldType.BOOLEAN,
fieldPath: includemodelsPath,
// This is in accordance with what the ingestion sources do.
getValueFromRecipeOverride: (recipe: any) => {
const includeModel = get(recipe, includemodelsPath);
if (includeModel !== undefined && includeModel !== null) {
return includeModel;
}
return true;
},
rules: null,
};

const includeviewlineagePath = 'source.config.include_view_lineage';
export const INCLUDE_VIEW_LINEAGE: RecipeField = {
name: 'include_view_lineage',
label: 'Include View Lineage',
tooltip: 'Extract View Lineage from source.',
type: FieldType.BOOLEAN,
fieldPath: includeviewlineagePath,
// This is in accordance with what the ingestion sources do.
getValueFromRecipeOverride: (recipe: any) => {
const includeviewlineage = get(recipe, includeviewlineagePath);
if (includeviewlineage !== undefined && includeviewlineage !== null) {
return includeviewlineage;
}
return true;
},
rules: null,
};

const includeprojectionlineagePath = 'source.config.include_projection_lineage';
export const INCLUDE_PROJECTIONS_LINEAGE: RecipeField = {
name: 'include_projection_lineage',
label: 'Include Projection Lineage',
tooltip: 'Extract Projection Lineage from source.',
type: FieldType.BOOLEAN,
fieldPath: includeprojectionlineagePath,
// This is in accordance with what the ingestion sources do.
getValueFromRecipeOverride: (recipe: any) => {
const includeprojectionlineage = get(recipe, includeprojectionlineagePath);
if (includeprojectionlineage !== undefined && includeprojectionlineage !== null) {
return includeprojectionlineage;
}
return true;
},
rules: null,
};
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
"name": "vertica",
"displayName": "Vertica",
"docsUrl": "https://datahubproject.io/docs/generated/ingestion/sources/vertica/",
"recipe": "source:\n type: vertica\n config:\n # Coordinates\n host_port: localhost:5433\n # The name of the vertica database\n database: Vmart\n # Credentials\n username: dbadmin\n password:null\n include_tables: true\n include_views: true\n include_projections: true\n include_oauth: true\n include_models: true\n include_view_lineage: true\n include_projection_lineage: true\n profiling:\n enabled: true\n stateful_ingestion:\n enabled: true "
"recipe": "source:\n type: vertica\n config:\n # Coordinates\n host_port: localhost:5433\n # The name of the vertica database\n database: Database_Name\n # Credentials\n username: Vertica_User\n password: Vertica_Password\n\n include_tables: true\n include_views: true\n include_projections: true\n include_models: true\n include_view_lineage: true\n include_projection_lineage: true\n profiling:\n enabled: false\n stateful_ingestion:\n enabled: true "
},
{
"urn": "urn:li:dataPlatform:custom",
Expand Down
1 change: 0 additions & 1 deletion metadata-ingestion/docs/sources/vertica/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ The DataHub Vertica Plugin extracts the following:
* Metadata for databases, schemas, views, tables, and projections
* Table level lineage
* Metadata for ML Models
* Metadata for Vertica OAuth


### Concept Mapping
Expand Down
2 changes: 1 addition & 1 deletion metadata-ingestion/docs/sources/vertica/vertica_pre.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

In order to ingest metadata from Vertica, you will need:

- Vertica Server Version 10.1.1-0 and avobe. It may also work for older versions.
- Vertica Server Version 10.1.1-0 and above. It may also work with, but is not been tested with, older versions .
- Vertica Credentials (Username/Password)
1 change: 0 additions & 1 deletion metadata-ingestion/docs/sources/vertica/vertica_recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ source:
include_tables: true
include_views: true
include_projections: true
include_oauth: true
include_models: true
include_view_lineage: true
include_projection_lineage: true
Expand Down
9 changes: 6 additions & 3 deletions metadata-ingestion/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,9 @@ def get_long_description():
"nifi": {"requests", "packaging", "requests-gssapi"},
"powerbi": microsoft_common | {"lark[regex]==1.1.4", "sqlparse"},
"powerbi-report-server": powerbi_report_server,
"vertica": sql_common | {"vertica-sqlalchemy-dialect[vertica-python]==0.0.1"},

"vertica": sql_common | {"vertica-sqlalchemy-dialect[vertica-python]==0.0.8"},

"unity-catalog": databricks | sqllineage_lib,
}

Expand Down Expand Up @@ -488,7 +490,8 @@ def get_long_description():
"powerbi-report-server",
"salesforce",
"unity-catalog",
"nifi"
"nifi",
"vertica"
# airflow is added below
]
if plugin
Expand Down Expand Up @@ -522,7 +525,7 @@ def get_long_description():
"mysql",
"mariadb",
"redash",
# "vertica",
"vertica",
]
for dependency in plugins[plugin]
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,13 @@ def _field_from_primitive(
isPartOfKey=field_path.is_key_schema,
)
elif datahub_field_type in [EnumTypeClass]:
# Convert enums to string representation
schema_enums = list(map(json.dumps, schema["enum"]))
yield SchemaField(
fieldPath=field_path.expand_type("enum", schema).as_string(),
type=type_override or SchemaFieldDataTypeClass(type=EnumTypeClass()),
nativeDataType="Enum",
description=f"one of {','.join(schema['enum'])}",
description=f"One of: {', '.join(schema_enums)}",
nullable=nullable,
jsonProps=JsonSchemaTranslator._get_jsonprops_for_any_schema(
schema, required=required
Expand Down
Loading

0 comments on commit eb33e88

Please sign in to comment.