Hi, I wrote a mysql recipe to ingest mydatabase sc...
# ingestion
b
Hi, I wrote a mysql recipe to ingest mydatabase schema into datahub. It is working except for the fact that it is bringing the schemas of all databases in myserver, instead of just the ones present in mydatabase. Any idea what is happening?
Copy code
---
# see <https://datahubproject.io/docs/metadata-ingestion/source_docs/mysql> for complete documentation
source:
  type: "mysql"
  config:
    username: my.user
    password: 12345678
    host_port: <http://myserver.com:21286|myserver.com:21286>
    database: mydatabase

# see <https://datahubproject.io/docs/metadata-ingestion/sink_docs/datahub> for complete documentation
sink:
  type: "datahub-rest"
  config:
    server: "<http://localhost:8080>"
Please use the allow/deny patterns to control what you want to ingest
actually - let me take that back since you are specifying the database
This seems to be a bug
for now, please
schema_pattern
allow/deny to control your ingestion
for example:
Copy code
schema_pattern:
       allow:
         - "^mydatabase"
b
Hi, Jagadish, thanks for the reply. I tested your suggestion and it worked. I do believe that it is returning all databases because of this code (sql_common.py ):
Copy code
def get_schema_names(self, inspector):
        return inspector.get_schema_names()
The
get_schema_names()
method always returns all available schemas in server no matter you selected a default schema. I think changing this code to:
Copy code
def get_schema_names(self, inspector):
    if inspector.default_schema_name is not None:
        return [inspector.default_schema_name]
    else:
        return inspector.get_schema_names()
May solve the problema
Would you like me to open an issue in github?
l
yes please file an issue
b
Issue opened #3204