code: def from_hive(tb_name, db_name, partitions):
      from pyspark.sql import SparkSession
  
      session = SparkSession.builder.enableHiveSupport().getOrCreate()
      rdd = materialize(
          session.sql(f"select * from {db_name}.{tb_name}")
          .rdd.map(HiveCoder.decode)
          .repartition(partitions)
      )
      return from_rdd(rdd=rdd)
  
imports: import logging
  import struct
  import typing
  from typing import Callable, Iterable, Tuple, Optional, Any
  import pyspark
  from pyspark.rddsampler import RDDSamplerBase
  from fate.arch import URI
  from fate.arch.computing.api import KVTable, ComputingEngine, K, V
  from fate.arch.computing.api._table import _lifted_reduce_to_serdes, get_serdes_by_type
  from ._materialize import materialize, unmaterialize
label_desc: Use image node_id 3 for calling a global function with example usage: from_hive(tb_name, db_name, partitions) and returns: from_rdd