you should use the same session of your DF:
df.sparkSession.sql("select count(*) from test_table limit 100")