parser icon indicating copy to clipboard operation
parser copied to clipboard

Support for spatial datatypes

Open gandhidharmil opened this issue 5 years ago • 1 comments

Feature Request

Is your feature request related to a problem? Please describe: I am trying to parse create table statements from mysqldump file. For the statements that include spatial mysql datatypes, parser is throwing error. Eg :

CREATE TABLE `geotest` (
  `code` int(5) DEFAULT NULL,
  `descrip` varchar(50) DEFAULT NULL,
  `g` geometry DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1

Describe the feature you'd like: Parser should be able to handle spatial datatypes. If it is not supported then at least it should throw error message saying that the following spatial datatype is not supported. It would also be good if just instead of spatial datatype, we can parse it as varchar datatype. Then also the purpose would be solved. Following are the spatial datatypes not supported :

  • "geometrycollection"
  • "multipoint"
  • "multilinestring"
  • "multipolygon"
  • "point"
  • "linestring"
  • "polygon"
  • "geometry"

Describe alternatives you've considered: From the error message, I am checking for a particular datatype. If error is due to spatial datatypes then I am replacing all spatial datatypes in 'CREATE TABLE' statement with 'text' datatype and parsing it again till parser accepts and return statement nodes.

gandhidharmil avatar May 13 '20 07:05 gandhidharmil

Thanks for the reporting... TiDB does not support geo-spatial types, that's why they're not included in current parser.

bb7133 avatar Oct 29 '20 14:10 bb7133