Skip to content

Commit

Permalink
Add logger to show jvm bridge launch info.
Browse files Browse the repository at this point in the history
  • Loading branch information
laneser committed Jun 22, 2020
1 parent 32d50aa commit 70add1d
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 4 deletions.
27 changes: 27 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/src/csharp/Microsoft.Spark.Worker/bin/Debug/netcoreapp3.1/Microsoft.Spark.Worker.dll",
"args": [],
"cwd": "${workspaceFolder}/src/csharp/Microsoft.Spark.Worker",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dotnet-test-explorer.testProjectPath": "src/csharp/Microsoft.Spark.UnitTest"
}
42 changes: 42 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/src/csharp/Microsoft.Spark.Worker/Microsoft.Spark.Worker.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/src/csharp/Microsoft.Spark.Worker/Microsoft.Spark.Worker.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/src/csharp/Microsoft.Spark.Worker/Microsoft.Spark.Worker.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
]
}
33 changes: 29 additions & 4 deletions src/csharp/Microsoft.Spark/Sql/Types/ComplexTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,22 @@ private DataType FromJson(JObject json)
return this;
}

internal override bool NeedConversion() => true;
internal override bool NeedConversion() => ElementType.NeedConversion();

internal override object FromInternal(object obj) => throw new NotImplementedException();
internal override object FromInternal(object obj)
{
if (!NeedConversion())
{
return obj;
}

var convertedObj = new List<object>();
foreach(object o in (dynamic)obj)
{
convertedObj.Add(ElementType.FromInternal(o));
}
return convertedObj;
}
}

/// <summary>
Expand Down Expand Up @@ -142,9 +155,21 @@ private DataType FromJson(JObject json)
return this;
}

internal override bool NeedConversion() => true;
internal override bool NeedConversion() => KeyType.NeedConversion() && ValueType.NeedConversion();

internal override object FromInternal(object obj) => throw new NotImplementedException();
internal override object FromInternal(object obj)
{
if (!NeedConversion())
{
return obj;
}
var convertedObj = new Dictionary<object, object>();
foreach(dynamic kv in (dynamic)obj)
{
convertedObj[kv.Key] = kv.Value;
}
return convertedObj;
}
}

/// <summary>
Expand Down

0 comments on commit 70add1d

Please sign in to comment.