You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "kezhenxu94 (via GitHub)" <gi...@apache.org> on 2023/02/09 10:57:48 UTC

[GitHub] [skywalking] kezhenxu94 commented on a diff in pull request #10367: Refactor `@Column` annotation, move column name that was used as logical sharding to legacy and deprecate it

kezhenxu94 commented on code in PR #10367:
URL: https://github.com/apache/skywalking/pull/10367#discussion_r1101291517


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/DeepAnalysis.java:
##########
@@ -136,7 +138,10 @@ public AnalysisResult analysis(AnalysisResult result) {
             for (Field field : c.getDeclaredFields()) {
                 Column column = field.getAnnotation(Column.class);
                 if (column != null) {
-                    result.addPersistentField(field.getName(), column.columnName(), field.getType());
+                    result.addPersistentField(
+                        field.getName(),
+                        !Strings.isNullOrEmpty(column.legacyName()) ? column.legacyName() : column.name(),
+                        field.getType());

Review Comment:
   > I think we are better to keep legacy column name as ElasticSearch only?
   
   legacy column is not only used in ElasticSearch storage, it's used in all other storage, moving it to ElasticSearch would make the codes look confusing and hard to understand.
   
   Here is an example, this is in `oal-rt` module, there is no reason we should use `ElasticSearch.Column`, that's really confusing why we should care about storage-specific implementation here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org