support distance function in where clause