muyangye opened a new pull request, #2196:
URL: https://github.com/apache/streampipes/pull/2196

   <!--
     ~ Licensed to the Apache Software Foundation (ASF) under one or more
     ~ contributor license agreements.  See the NOTICE file distributed with
     ~ this work for additional information regarding copyright ownership.
     ~ The ASF licenses this file to You under the Apache License, Version 2.0
     ~ (the "License"); you may not use this file except in compliance with
     ~ the License.  You may obtain a copy of the License at
     ~
     ~    http://www.apache.org/licenses/LICENSE-2.0
     ~
     ~ Unless required by applicable law or agreed to in writing, software
     ~ distributed under the License is distributed on an "AS IS" BASIS,
     ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     ~ See the License for the specific language governing permissions and
     ~ limitations under the License.
     ~
     -->
     
     <!--
   Thanks for contributing! Here are some tips you can follow to help us 
incorporate your contribution quickly and easily:
   1. If this is your first time, please read our contributor guidelines:
       - https://streampipes.apache.org/getinvolved.html
       - https://cwiki.apache.org/confluence/display/STREAMPIPES/Getting+Started
   2. Make sure the PR title is formatted like: `[#<GitHub issue id>] PR title 
...`
   3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., 
`[WIP][#<GitHub issue id>] PR title ...`.
   4. Please write your PR title to summarize what this PR proposes/fixes.
   5. Link the PR to the corresponding GitHub issue (if present) in the 
`Development` section in the right menu bar. 
   6. Be sure to keep the PR description updated to reflect all changes.
   7. If possible, provide a concise example to reproduce the issue for a 
faster review.
   8. Make sure tests pass via `mvn clean install`.
   9. (Optional) If the contribution is large, please file an Apache ICLA
       - http://apache.org/licenses/icla.pdf
   -->
   
   ### Purpose
   <!--
   Please clarify what changes you are proposing and describe how those changes 
will address the issue.
   Furthermore, describe potential consequences the changes might have.
   -->
   See #2106 
   
   ### Remarks
   <!--
   Is there anything left we need to pay attention on?
   Are there some references that might be important? E.g. links to Confluence, 
or discussions
   on the mailing list or GitHub.
   -->
   PR introduces (a) breaking change(s): no
   
   PR introduces (a) deprecation(s): no
   
   I treated ListField and NestedField as the same and used Jackson to 
serialize them into string.
   
   For this test adapter: 
![9a64bd488ff1a0cc8cd422783dc4e13](https://github.com/apache/streampipes/assets/76769570/7a038e6e-e646-4689-bcd5-8413b814b3fe)
   Now we can see the raw value being stored (but not other visualizations such 
as table because they are not implemented yet): 
   
![cf10c485fdb20dbc6ea6285610d1ddd](https://github.com/apache/streampipes/assets/76769570/8b44a8ed-c3ea-4071-8a8b-815c9fe9e9a6)
   The raw value doesn't show deserialization result, so I have left some 
commented out codes that do the deserialization and below shows that the 
original types are kept:
   
![808b41dab8710524cff2b57aca2f930](https://github.com/apache/streampipes/assets/76769570/7dc0a841-263a-4d25-b611-3a02e29ea934)
   
   ### **HOWEVER**
   I am a little skeptical about my approach so please let me know if this is 
okay. I am somewhat confused on the difference between serializing 
Abstract/Primitive/List/Nested Field vs. serializing raw values. The reasons I 
chose to serialize raw values are:
   
   - Serializing Abstract/Primitive/List/Nested Field which includes 
inheritance is very hard, I have found multiple resources online but no luck to 
get the correct result.
   - Later I found out the serialization/deserialization of those Fields are 
unnecessary because InfluxDB is actually storing runtime name and raw value.
   
   Let me know if it is necessary to serialize those Fields. Currently I don't 
think so because during deserialization, we can check `instanceof List` and 
`instanceof Map` for `Object`, just like we use `instanceof ListField` and 
`instanceof NestedField` for `AbstractField`.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to