Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix order of operations when using mkString in typeConversionInfo #3113

Merged
merged 4 commits into from
Aug 9, 2021

Conversation

abellina
Copy link
Collaborator

@abellina abellina commented Aug 2, 2021

Prior to this, the explain was broken when doing type conversions (this was found while reviewing: #2971).

      *Exec <ObjectHashAggregateExec> will run on GPU
 ; T; h; e;  ; d; a; t; a;  ; t; y; p; e;  ; o; f;  ; f; o; l; l; o; w; i; n; g;  ; e; x; p; r; e; s; s; i; o; n; s;  ; w; i; l; l;  ; b; e;  ; c; o; n; v; e; r; t; e; d;  ; i; n;  ; G; P; U;  ; r; u; n; t; i; m; e; :; 
; S; e; t; (; C; o; n; v; e; r; t; e; d;  ; D; a; t; a; T; y; p; e;  ; o; f;  ; b; u; f;  ; f; r; o; m;  ; B; i; n; a; r; y; T; y; p; e;  ; t; o;  ; A; r; r; a; y; T; y; p; e; (; I; n; t; e; g; e; r; T; y; p; e; ,; f; a; l; s; e; ); ,;  ; b; e; c; a; u; s; e;  ; C; o; n; v; e; r; t; e; d;  ; B; i; n; a; r; y; T; y; p; e;  ; t; o;  ; A; r; r; a; y; T; y; p; e; (; I; n; t; e; g; e; r; T; y; p; e; ,; f; a; l; s; e; ); ,;  ; b; e; c; a; u; s; e;  ; )

This tweaks the explain so it's in one line, and does some minor fixes. The original function duplicated the message, but I think the code I have here is safe since the typeMeta passed looks to be at the same expression level, and contains the same data as caller. It would be good to get confirmation I understood this correctly.

           *Exec <ObjectHashAggregateExec> will run on GPU. The data type of following expressions will be converted in GPU runtime: buf#10: Converted BinaryType to ArrayType(IntegerType,false)

Signed-off-by: Alessandro Bellina <abellina@nvidia.com>
@abellina
Copy link
Collaborator Author

abellina commented Aug 4, 2021

build

@sameerz sameerz added the task Work required that improves the product but is not user facing label Aug 4, 2021
@abellina
Copy link
Collaborator Author

abellina commented Aug 5, 2021

@andygrove do you have any other comments for this PR?

s" but is going to be removed because $reasons"
}

private def typeConversionInfo: String = typeConversionReasons match {
case None => ""
case Some(v) if v.isEmpty => ""
case Some(v) =>
" The data type of following expressions will be converted in GPU runtime:\n" +
v mkString "; "
"The data type of following expressions will be converted in GPU runtime: " +
Copy link
Collaborator

@razajafri razajafri Aug 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: string interpolator can be used here?

val reasonMsg = (if (typeConverted) reason else None)
.map(r => s", because $r").getOrElse("")
s"Converted ${wrapped.getOrElse("N/A")} to " +
s"${dataType.getOrElse("N/A")}" + reasonMsg
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: same here we can use $reasonMsg inside the string

@andygrove
Copy link
Contributor

@andygrove do you have any other comments for this PR?

Sorry for the delay. LGTM.

@revans2 revans2 merged commit eb18b1e into NVIDIA:branch-21.10 Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Work required that improves the product but is not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants