be able to add fields to featureclass and not break a view

590
2
06-03-2021 09:42 AM
Status: Open
KevinMacLeodCAI
Occasional Contributor II

I had a related inspection table to a sewer line feature class. I defined a view to join these so as to symbolize on attributes in the related table. The view broke when I added another field to the sewer line feature class. I defined it as *  to bring all featureclass fields in so that is curious it breaks. Simply copy and pasting the exact same SQL view back into Catalog to create it again, it works fine. So some internal stuff must get saved and hard coded at the creation time of the view in Catalog and adding a field breaks it. I could understand removing a field but not why adding one would break it.  If this is expected behavior I suggest allowing new fields to be added to FCs in a View. It would be useful because views are often powering web services as this one was.

2 Comments
JonEmch

Hey there Kevin,

   When views get created, the schema of the view will inherit the schema of the feature class at creation. If the schema changes, this will cause the behavior to break (as you mentioned). Regardless of removing or adding the field, the schema change would be enough to break this.

   If you would prefer, I would recommend logging an idea for this in the ideas forum, but as you wrote it it sounds like expected behavior.

KevinMacLeodCAI

Hi Jon thank you for your reply. Isn't this Ideas? It says Ideas in the URL?

 

Since this is the intended design, I would put forth factoring this in for the next Enterprise major version update, as an Idea. There are many times when changing schemas break things. I suggest creating more graceful failure or working around schema changes across the platform, especially if it's just adding a field. Simply not showing the field would be fine. Even though I'd expect with a '*' that frankly adding fields should "just work". But Webmaps are also very fragile and this is a related problem because schema changes necessitate republishing which in turn breaks webmaps. (re-adding the layer, now it has a new 'webmap layer id', which is also useful to use for other things https://community.esri.com/t5/arcgis-online-ideas/keep-webmap-service-item-id-static/m-p/932310) Now, you can paste most JSON back via Assistant but that's...fragile and requires care to use, as well. Nevertheless, I would suggest as a general platform idea for the next ten years as a focus is creating products that once created, can be changed, without substantial engineering. Currently things can be created easily in the ArcGIS platform but once they need a change or adjustment, seem to require a lot of effort.  I know that can be a tall order and require a lot of engineering under the hood but I think it would be a worthy effort.