From df84f4b539ab56cae20bb4161ff190a7adc0ca70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=98=E5=BB=BA=E4=B8=9C?= <617601767@qq.com> Date: Sat, 9 Mar 2024 14:38:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9B=E8=A1=8Cnull=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hadoop/ZKLT.Hadoop.API/Program.cs | 28 ++++++++++++++-------------- Hadoop/ZKLT.Hadoop/TableService.cs | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Hadoop/ZKLT.Hadoop.API/Program.cs b/Hadoop/ZKLT.Hadoop.API/Program.cs index 3d373ef..98637bc 100644 --- a/Hadoop/ZKLT.Hadoop.API/Program.cs +++ b/Hadoop/ZKLT.Hadoop.API/Program.cs @@ -40,34 +40,34 @@ namespace ZKLT.Hadoop.API app.UseCors("all"); #endregion - app.UseHadoop((c) => - { - c.Host = "127.0.0.1"; - c.Account = "root"; - c.PassWord = "root"; - c.Key = "devdb"; - c.Port = 3306; - }); - - //app.UseHadoop((c) => //{ - // c.Host = "172.17.0.1"; + // c.Host = "127.0.0.1"; // c.Account = "root"; // c.PassWord = "root"; - // c.Key = "testdb"; - // c.Port = 4000; + // c.Key = "devdb"; + // c.Port = 3306; //}); + //app.UseHadoop((c) => //{ - // c.Host = "118.195.165.218"; + // c.Host = "172.17.0.1"; // c.Account = "root"; // c.PassWord = "root"; // c.Key = "testdb"; // c.Port = 4000; //}); + app.UseHadoop((c) => + { + c.Host = "118.195.165.218"; + c.Account = "root"; + c.PassWord = "root"; + c.Key = "testdb"; + c.Port = 4000; + }); + // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { diff --git a/Hadoop/ZKLT.Hadoop/TableService.cs b/Hadoop/ZKLT.Hadoop/TableService.cs index 9c28e6f..0d3658a 100644 --- a/Hadoop/ZKLT.Hadoop/TableService.cs +++ b/Hadoop/ZKLT.Hadoop/TableService.cs @@ -319,7 +319,7 @@ namespace ZKLT.Hadoop for (var i = 0; i < table.Columns.Length; i++) { var _column = table.Columns[i]; - if (row.ContainsKey(_column.Key!)) + if (row.ContainsKey(_column.Key!) && row[_column.Key!] != null) { _colstr.Append($@"`{_column.Key!}`,"); _parmstr.Append($@"@{_column.Key},"); @@ -405,7 +405,7 @@ namespace ZKLT.Hadoop for (var i = 0; i < table.Columns.Length; i++) { var _column = table.Columns[i]; - if (row.ContainsKey(_column.Key!) && !where.ContainsKey(_column.Key!)) + if (row.ContainsKey(_column.Key!) && !where.ContainsKey(_column.Key!) && row[_column.Key!] != null) { _colstr.Append($@"`{_column.Key!}`=@{_column.Key!},"); _params.Add(_column.Key!, row[_column.Key!]);