jcamachor commented on a change in pull request #1542: URL: https://github.com/apache/hive/pull/1542#discussion_r504964132
########## File path: standalone-metastore/metastore-server/src/main/resources/package.jdo ########## @@ -1549,6 +1549,83 @@ <column name="RM_DUMP_EXECUTION_ID"/> </index> </class> + + <class name="MStoredProc" table="STORED_PROCS" identity-type="datastore" detachable="true"> + <datastore-identity> + <column name="SP_ID"/> + </datastore-identity> + <field name="createTime"> + <column name="CREATE_TIME" jdbc-type="integer" allows-null="false"/> + </field> + <field name="lastAccessTime"> + <column name="LAST_ACCESS_TIME" jdbc-type="integer" allows-null="false"/> + </field> + <field name="database"> + <column name="DB_ID" allows-null="false"/> + </field> + <field name="name"> + <column name="NAME" length="256" jdbc-type="VARCHAR" allows-null="false"/> + </field> + <field name="owner"> + <column name="OWNER_NAME" length="128" jdbc-type="VARCHAR" allows-null="false"/> + </field> + <field name="source"> + <column name="SOURCE" jdbc-type="MEDIUMTEXT" allows-null="false"/> + </field> + <field name="language"> + <column name="LANG" jdbc-type="varchar" length="128" allows-null="false"/> + </field> + <field name="returnType"> + <column name="RET_TYPE" jdbc-type="varchar" length="128" allows-null="true"/> + </field> + <field name="parameters" table="SP_POS_ARGS" > + <collection element-type="MPosParam"/> + <join> + <column name="SP_ID"/> + </join> + <element> + <embedded> + <field name="name"> + <column name="NAME" jdbc-type="varchar" length="256" allows-null="false"/> + </field> + <field name="type"> + <column name="TYPE" jdbc-type="varchar" length="128" allows-null="false"/> + </field> + <field name="length"> + <column name="length" jdbc-type="integer" allows-null="true"/> + </field> + <field name="scale"> + <column name="scale" jdbc-type="integer" allows-null="true"/> + </field> + <field name="isOut"> + <column name="OUT" allows-null="false"/> + </field> + </embedded> + </element> + </field> Review comment: Thanks @zeroflag for working on this , this is very cool. There are a few challenges with keeping redundant information outside of the procedure text that I can think of. One of them is that while the semantics of the procedure definition may be well defined, the representation for the other fields may not be defined clearly. Another usual challenge is that if there are any changes in the future, you will have to ensure backwards compatibility for those fields too. Going through the specific implementation of type handling, it seems you are keeping length and scale in different fields. This is not done when we store types in HMS for Hive. Any reason for that? Also, checking the documentation, it seems HPL/SQL can apply some transformations to the field type. Are those transformations applied before storing the definition or later on? Based on that, I think keeping a lean representation in HMS has its advantages like @kgyrtkirk mentioned, specifically if those fields are not actually being used for the time being. It's preferable to add those fields later on if needed, rather than backtracking and removing fields. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org