krlawrence / graph

Practical Gremlin - An Apache TinkerPop Tutorial
Apache License 2.0
830 stars 251 forks source link

Change SQL version of Airports to use a larger field for the city name #219

Closed krlawrence closed 12 months ago

krlawrence commented 3 years ago

Since the data set was first created several cities have been added that have a name longer than the 20 characters allowed by the VARCHAR(20) in the airports table. Sqlite3 seems to ignore this and create the values anyway but other stores such as Postgres throw an error.

gremlin> g.V().hasLabel('airport').filter {it.get().value('city').size() > 20}.count()
==>92  

gremlin> g.V().hasLabel('airport').filter {it.get().value('city').size() > 35}.values('city')
==>Sta Cruz de la Palma, La Palma Island

gremlin> g.V().hasLabel('airport').filter {it.get().value('city').size() > 35}.values('city').map {it.get().size()}
==>37     
krlawrence commented 12 months ago

Closing as this is fixed and work has now started on the second edition. There will likely be one final release of the v283 first edition line before the V2 branch becomes the second edition. That release will include these fixes.