You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@streampipes.apache.org by "SteveYurongSu (via GitHub)" <gi...@apache.org> on 2023/02/21 18:24:30 UTC

[PR] [#1921] Can't aggregate calculation results of the Math processing element (streampipes)

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

   <!--
     ~ 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.
   -->
   
   **Root cause:**  
   `InfluxStore` can not correctly storage `EventPropertyPrimitive` with `runtimeType = SO.NUMBER` as a number field in InfluxDB. 
   A `EventPropertyPrimitive` with `runtimeType = SO.NUMBER` is stored directly as a `string` type field, which can not be used in some aggregation functions such as `mean`.
   
   <img width="1279" alt="image" src="https://user-images.githubusercontent.com/30497621/220427297-6066d1bc-061b-45e9-9892-99ea4710c05f.png">
   <img width="962" alt="image" src="https://user-images.githubusercontent.com/30497621/220427323-b4a8c8e5-a44b-444a-aac2-5c3b57700f70.png">
   
   Actually, I have checked three possible points which may cause the issue:
   1. Processor: wrong output field types of `MathOpProcessor `
   2. DataLake: `InfluxStore` converts some field data types before insertion
   3. Frontend: wrong number field selection logic in `FieldSelectionPanelComponent`
   
   The check results:
   1. fine
   2. root cause
   3. may have a potential issue: fields with type of `XSD.LONG` may not be shown by the panel. I fixed it.
   
   ### Tests
   <img width="657" alt="image" src="https://user-images.githubusercontent.com/30497621/220427146-f72f287c-2f96-4733-8539-f9b7ad446920.png">
   The field type of calculationResult is float now.
   
   ### 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): <yes/no>
   no
   
   PR introduces (a) deprecation(s): <yes/no>
   no


-- 
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: dev-unsubscribe@streampipes.apache.org

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


Re: [PR] [#1291] Can't aggregate calculation results of the Math processing element (streampipes)

Posted by "bossenti (via GitHub)" <gi...@apache.org>.
bossenti commented on code in PR #1340:
URL: https://github.com/apache/streampipes/pull/1340#discussion_r1114656615


##########
ui/src/app/data-explorer/services/data-explorer-field-provider-service.ts:
##########
@@ -194,10 +194,12 @@ export class DataExplorerFieldProviderService {
                 runtimeType === 'http://www.w3.org/2001/XMLSchema#float' ||

Review Comment:
   Ah it is about `http` vs `https` 💡 
   Didn't recognize the decisive difference so far 😅 



-- 
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: dev-unsubscribe@streampipes.apache.org

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


Re: [PR] [#1291] Can't aggregate calculation results of the Math processing element (streampipes)

Posted by "SteveYurongSu (via GitHub)" <gi...@apache.org>.
SteveYurongSu commented on code in PR #1340:
URL: https://github.com/apache/streampipes/pull/1340#discussion_r1114644920


##########
ui/src/app/data-explorer/services/data-explorer-field-provider-service.ts:
##########
@@ -194,10 +194,12 @@ export class DataExplorerFieldProviderService {
                 runtimeType === 'http://www.w3.org/2001/XMLSchema#float' ||

Review Comment:
   The string prefix `https://www.w3.org/2001` appears only five times in all files, and it only appears in files related to the ui. It seems that we can remove the code associated with the prefix...
   
   <img width="1020" alt="image" src="https://user-images.githubusercontent.com/30497621/220693506-afd59b32-01ab-402d-ba2c-52e3e48ec0fb.png">
   



-- 
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: dev-unsubscribe@streampipes.apache.org

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


Re: [PR] [#1291] Can't aggregate calculation results of the Math processing element (streampipes)

Posted by "dominikriemer (via GitHub)" <gi...@apache.org>.
dominikriemer merged PR #1340:
URL: https://github.com/apache/streampipes/pull/1340


-- 
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: dev-unsubscribe@streampipes.apache.org

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


Re: [PR] [#1291] Can't aggregate calculation results of the Math processing element (streampipes)

Posted by "SteveYurongSu (via GitHub)" <gi...@apache.org>.
SteveYurongSu commented on code in PR #1340:
URL: https://github.com/apache/streampipes/pull/1340#discussion_r1114665058


##########
ui/src/app/data-explorer/services/data-explorer-field-provider-service.ts:
##########
@@ -194,10 +194,12 @@ export class DataExplorerFieldProviderService {
                 runtimeType === 'http://www.w3.org/2001/XMLSchema#float' ||

Review Comment:
   Haha, yes it's about http vs https 😂
   
   But it's weird we have those https in our code, it seems to be useless... I have pushed a commit to remove them.



-- 
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: dev-unsubscribe@streampipes.apache.org

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


Re: [PR] [#1291] Can't aggregate calculation results of the Math processing element (streampipes)

Posted by "bossenti (via GitHub)" <gi...@apache.org>.
bossenti commented on code in PR #1340:
URL: https://github.com/apache/streampipes/pull/1340#discussion_r1113528211


##########
ui/src/app/data-explorer/services/data-explorer-field-provider-service.ts:
##########
@@ -194,10 +194,12 @@ export class DataExplorerFieldProviderService {
                 runtimeType === 'http://www.w3.org/2001/XMLSchema#float' ||

Review Comment:
   I probably missed something here, but why do we have duplicate conditions here? line 193 until 197 is the same as 198 to 202, isn't it?



-- 
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: dev-unsubscribe@streampipes.apache.org

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


Re: [PR] [#1291] Can't aggregate calculation results of the Math processing element (streampipes)

Posted by "tenthe (via GitHub)" <gi...@apache.org>.
tenthe commented on PR #1340:
URL: https://github.com/apache/streampipes/pull/1340#issuecomment-1439058765

   Thank you for the PR and fixing the issue. 
   The detailed description made the review quite easy.


-- 
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: dev-unsubscribe@streampipes.apache.org

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