private static RelNode copyNodeScanNewCluster(RelOptCluster optCluster, RelNode scan) {
    final RelNode newScan;
    if (scan instanceof DruidQuery) {
      final DruidQuery dq = (DruidQuery) scan;
      // Ideally we should use HiveRelNode convention. However, since Volcano planner
      // throws in that case because DruidQuery does not implement the interface,
      // we set it as Bindable. Currently, we do not use convention in Hive, hence that
      // should be fine.
      // TODO: If we want to make use of convention (e.g., while directly generating operator
      // tree instead of AST), this should be changed.
      newScan = DruidQuery.create(optCluster, optCluster.traitSetOf(BindableConvention.INSTANCE),
          scan.getTable(), dq.getDruidTable(), ImmutableList.of(dq.getTableScan()),
          DruidSqlOperatorConverter.getDefaultMap());
    } else {
      newScan = new HiveTableScan(optCluster, optCluster.traitSetOf(HiveRelNode.CONVENTION),
          (RelOptHiveTable) scan.getTable(), ((RelOptHiveTable) scan.getTable()).getName(),
          null, false, false);
    }
    return newScan;
  }
Validate if given materialized view has SELECT privileges for current user
@param cachedMVTableList
@return false if user does not have privilege otherwise true
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/views/HiveMaterializedViewUtils.java