First: As the title.
Second: I think we can change the method getTiDBSnapshot(sparksession) in TiUtil to lazy val.
Third: The 'override def initialize in TiCatalog' , I think we can just change the sparkConfToTiConfWithoutPD to sparkConfToTiConf so that we would not gave the 'pd.addresses' twice (spark.tispark.pd.addresses and spark.sql.catalog.tidb_catalog.pd.addresses)
First: As the title. Second: I think we can change the method getTiDBSnapshot(sparksession) in TiUtil to lazy val. Third: The 'override def initialize in TiCatalog' , I think we can just change the sparkConfToTiConfWithoutPD to sparkConfToTiConf so that we would not gave the 'pd.addresses' twice (spark.tispark.pd.addresses and spark.sql.catalog.tidb_catalog.pd.addresses)