TIBCOSoftware / snappy-store

SnappyStore
Apache License 2.0
39 stars 18 forks source link

[SNAP 3104] Showing external hive metastore tables as part of HIVETABLES VTI #530

Open vatsalmevada opened 4 years ago

vatsalmevada commented 4 years ago

Changes proposed in this pull request

Showing external hive metastore tables as part of HIVETABLES VTI

Approach

Keeping a flag hiveSessionInitialized as part of the profile of the lead node with the default value set to false. When the hive session is initialized on the lead node, we set this flag to true and distribute the updated profile.

When SYS.HIVETABLES VIT is executed on a server node, the server node checks whether hiveSessionInitialized is set to true in lead's profile. If it is set to true it executes ExternalHiveTablesCollectorFunction on the lead node to fetch the metadata of hive tables available on external hive metastore.

ExternalHiveTablesCollectorFunction is only executed when hiveSessionInitialized is set to true to avoid unnecessary remote function call.


Note that server need to fetch these details from the leader node as the hive session is available only one leader.

Patch testing

precheckin -Pstore Manually tested. Will add automated coverage.

Other PRs

https://github.com/SnappyDataInc/snappydata/pull/1472