Andy Carter
07/16/2024, 4:15 PMdiscover
is generating a catalog entry for each of the 1000s of tables.
Is there any way to avoid this? I have a select
in my meltano.yml already but that doesn't seem to prevent it, only stops the records from non-required tables getting emitted.BuzzCutNorman
07/16/2024, 5:30 PMvisch
07/16/2024, 5:38 PMAndy Carter
07/16/2024, 5:39 PMdbo
๐visch
07/16/2024, 5:41 PMfilter_tables
๐ฎBuzzCutNorman
07/16/2024, 5:45 PMvisch
07/16/2024, 6:42 PMvisch
07/16/2024, 6:42 PMBuzzCutNorman
07/16/2024, 7:17 PMCharles Feduke
07/16/2024, 9:11 PMAndy Carter
07/17/2024, 7:18 AMfilter_tables
already exist on a SQL tap somewhere I could pinch an implementation from? I'm guessing I'm going to have to fork here.Andy Carter
07/17/2024, 7:20 AMdiscover_catalog_entries
like in this PR, but probably for a include rather than exclude list
https://github.com/meltano/sdk/pull/2482/filesvisch
07/17/2024, 12:52 PMvisch
07/17/2024, 12:53 PMAndy Carter
07/17/2024, 1:28 PMdef get_object_names(
self, engine, inspected, schema_name: str
) -> list[tuple[str, bool]]:
# Get list of tables and views
if self.config.get('fake_it', False):
table_names = ['my_table']
view_names = []
return [(t, False) for t in table_names] + [(v, True) for v in view_names]
else:
super().get_object_names(engine, inspected, schema_name)
def get_schema_names(self, engine, inspected) -> list[str]:
return ['dbo']
Hacky but I like it ๐visch
07/17/2024, 1:29 PMfake_it
๐Andy Carter
07/17/2024, 1:30 PMfinally:
make_it()
Andy Carter
07/17/2024, 1:55 PMselected
by hardcoding True
in the SDK, there are no fields in the stream (presumably they are all deselected too).
Any pointers? Or do I just need to run it in meltano now rather than CLI directly?
If I look at the stream mask, everything is coming back unselectedBuzzCutNorman
07/17/2024, 2:16 PMmeltano install --clean
once you get the `meltano.yml' file all set and saved.
- name: tap-mssql
namespace: tap_mssql
pip_url: -e ..\\..\\buzzcutnorman\\tap-mssql
capabilities:
- catalog
- state
- discover
- about
- stream-maps
- schema-flattening
settings:
- name: dialect
- name: driver_type
- name: host
- name: port
kind: integer
- name: user
- name: password
kind: string
sensitive: true
- name: database
- name: driver
- name: sqlalchemy_eng_params
kind: object
- name: fast_executemany
- name: future
- name: sqlalchemy_url_query
kind: object
- name: driver
- name: TrustServerCertificate
- name: MultiSubnetFailover
- name: batch_config
kind: object
- name: encoding
kind: object
- name: format
- name: compression
- name: storage
kind: object
- name: root
- name: prefix
- name: start_date
- name: hd_jsonschema_types
kind: boolean
config:
dialect: mssql
driver_type: pyodbc
host: [you mssql server]
user: [your username]
database: [your-datebase]
sqlalchemy_eng_params:
fast_executemany: 'True'
sqlalchemy_url_query:
driver: ODBC Driver 18 for SQL Server
TrustServerCertificate: yes
MultiSubnetFailover: yes
Andy Carter
07/17/2024, 2:27 PM2024-07-17 15:25:40,156 Selection metadata omitted for '()'. Using parent value of selected=None.
visch
07/17/2024, 2:28 PMBuzzCutNorman
07/17/2024, 2:33 PMAndy Carter
07/17/2024, 2:36 PMBuzzCutNorman
07/17/2024, 2:41 PMBuzzCutNorman
07/17/2024, 2:44 PMAndy Carter
07/17/2024, 2:48 PMdef _breadcrumb_is_selected(self, breadcrumb: Breadcrumb) -> bool:
return True
in the SDK to get any records out via the cli.
Will try now in a fuller meltano project and see what happens.Andy Carter
07/18/2024, 9:14 AM