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.
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 tofalse
. When the hive session is initialized on the lead node, we set this flag totrue
and distribute the updated profile.When
SYS.HIVETABLES
VIT is executed on a server node, the server node checks whetherhiveSessionInitialized
is set totrue
in lead's profile. If it is set totrue
it executesExternalHiveTablesCollectorFunction
on the lead node to fetch the metadata of hive tables available on external hive metastore.ExternalHiveTablesCollectorFunction
is only executed whenhiveSessionInitialized
is set totrue
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