[distance] Support different variant type

Add support for different variant type as parameters