GithubHelp home page GithubHelp logo

Comments (2)

AlekHed avatar AlekHed commented on June 2, 2024 1

I have the same problem. Oracle DB integration has some weak points:

  1. It uses "SELECT name FROM v$database" query for testing connection. User need to have "GRANT SELECT ANY DICTIONARY TO user" for this query to work. Better solution imo is to use something like "select sys_context( 'userenv', 'current_schema' ) from dual" query.

  2. Its possible to define schema for connection if you redefine property table_prefix in OracleDB class. I set it to read schema from self.config['schema'] if it exists in my local version. It could solve 90% problems with schemas. But most correct solution of course is to use schema from table definition.

  3. For Oracle versions prior to 12 _limit_query_string makes incorrect query string. Feels like connector need parameter to support old version recipe. But its complex modification. Need more hooks to query at sql base class.

from mage-ai.

amukhsimov avatar amukhsimov commented on June 2, 2024

Hello!

I think I found the problem. In mage_integrations/mage_integrations/sources/oracledb/init.py when mage discovers the schema it doesn't consider table owner (schema) (screenshot 1).

Then in mage_integrations/mage_integrations/sources/sql/base.py discover function, it passes stream_id as tap_stream_id to __fetch_rows function (whereas stream_id is only a TABLE_NAME).

__fetch_rows uses build_table_name function, which returns f'{self.table_prefix}{table_name}', whereas self.table_prefix returns '' (empty string)

Can we add the schema to the Oracle source (data integration)?

image
image
image

from mage-ai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.