RelNode sortLimit(RexNode offsetRN, RexNode fetchRN) throws SemanticException {
      genOBProject();

      if (fieldCollations.isEmpty()) {
        return endGenOBLogicalPlan(obInputRel);
      }

      // 4. Construct SortRel
      RelOptCluster cluster = calcitePlannerAction.cluster;
      RelTraitSet traitSet = cluster.traitSetOf(HiveRelNode.CONVENTION);
      RelCollation canonizedCollation = RelCollations.of(fieldCollations);
      RelNode sortRel = new HiveSortLimit(cluster, traitSet, obInputRel, canonizedCollation, offsetRN, fetchRN);
      return endGenOBLogicalPlan(sortRel);
    }
This method can be called at startup time to pre-register all the
additional Hive classes (compared to Calcite core classes) that may
be visited during the planning phase in the metadata providers
and the field trimmer.
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java