[SPARK-1512] improve spark sql to support table with more than 22 fields