Hive多DISTINCT性能优化:用COLLECT_SET替代COUNT(DISTINCT)
2026/10/13 7:36:05
在远程机器上执行PowerShell表达式时,需要收集输出和错误输出。以下是具体的操作步骤:
1.收集输出和错误输出:
$errorOutput = [IO.Path]::GetTempFileName() $output = psexec /acceptEula $computer cmd /c $commandLine 2>$errorOutput$errorContent = Get-Content $errorOutput Remove-Item $errorOutput if($errorContent -match "Access is denied") { $OFS = "`n" $errorMessage = "Could not execute remote expression. " $errorMessage += "Ensure that your account has administrative " + "privileges on the target machine.`n" $errorMessage += ($errorContent -match "psexec.exe :