| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
This pull request adds support for resolving Oracle STRUCT types into CDAP RECORD schemas by querying the ALL_TYPE_ATTRS metadata table. The implementation includes recursive resolution for nested structures and an updated mapping for primitive Oracle types. Feedback highlights several critical issues: the metadata query lacks an OWNER filter which could lead to incorrect schema resolution in multi-schema environments; fully qualified type names containing dots will cause IllegalArgumentException when creating CDAP records; and there are logic errors in the primitive type mapping, specifically regarding Oracle-specific type naming conventions and an invalid comparison between Java class names and SQL type strings.
Sorry, something went wrong.
# Conflicts: # oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleSourceSchemaReader.java # oracle-plugin/src/test/java/io/cdap/plugin/oracle/OracleSchemaReaderTest.java
| recordBuilder.set(field.getName(), bigDecimal.longValue()); | ||
| break; | ||
| case STRING: | ||
| recordBuilder.set(field.getName(), bigDecimal.toString()); |
There was a problem hiding this comment.
use toPlainString()
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry, something went wrong.
| } | ||
| } | ||
|
|
||
| private void handleOffsetDateTimeValue(OffsetDateTime offsetDateTime, Schema fieldSchema, |
There was a problem hiding this comment.
These types would be at top level/root level also and their handling should already exist, any specific reason we are handling record members separately?
Sorry, something went wrong.
There was a problem hiding this comment.
this comment applies to all types handling
Sorry, something went wrong.
There was a problem hiding this comment.
Top-level columns are read directly from the ResultSet using column positions, but STRUCT members come from struct.getAttributes() as raw Java objects where no ResultSet is available. Also, Oracle returns all STRUCT numbers as BigDecimal, dates as Timestamp/OffsetDateTime, and LOBs as Clob/Blob objects. We need this handling in populateRecordField to convert these raw objects into the correct types so that their value can be stored properly.
Sorry, something went wrong.
There was a problem hiding this comment.
May be then we can move these in a separate Struct specific class
Sorry, something went wrong.
|
Sorry, something went wrong.
There was a problem hiding this comment.
The test report says coverage is around 30%, why it's so low?
Sorry, something went wrong.
| } | ||
| } | ||
|
|
||
| private void handleOffsetDateTimeValue(OffsetDateTime offsetDateTime, Schema fieldSchema, |
There was a problem hiding this comment.
May be then we can move these in a separate Struct specific class
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This change adds native support for resolving Oracle STRUCT types (Object Types) into CDAP RECORD schemas. By querying the ALL_TYPE_ATTRS metadata table, the schema builder dynamically processes complex structures with support for up to 4 levels of nesting. Internal attributes are first translated to standard SQL data types via a dedicated mapper before being converted into the final CDAP schema.
When reading the data, the implementation overrides the setField() function, providing a custom implementation to properly extract and map individual custom object attributes according to requirements.
Note: Users will require explicit EXECUTE privileges on the custom Oracle object types to successfully resolve the schema.
Test Coverage :
