修改对数据进行null的判断

pull/1/head
潘建东 9 months ago
parent e349ae85fd
commit df84f4b539

@ -40,34 +40,34 @@ namespace ZKLT.Hadoop.API
app.UseCors("all"); app.UseCors("all");
#endregion #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) => //app.UseHadoop((c) =>
//{ //{
// c.Host = "172.17.0.1"; // c.Host = "127.0.0.1";
// c.Account = "root"; // c.Account = "root";
// c.PassWord = "root"; // c.PassWord = "root";
// c.Key = "testdb"; // c.Key = "devdb";
// c.Port = 4000; // c.Port = 3306;
//}); //});
//app.UseHadoop((c) => //app.UseHadoop((c) =>
//{ //{
// c.Host = "118.195.165.218"; // c.Host = "172.17.0.1";
// c.Account = "root"; // c.Account = "root";
// c.PassWord = "root"; // c.PassWord = "root";
// c.Key = "testdb"; // c.Key = "testdb";
// c.Port = 4000; // 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. // Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment()) if (app.Environment.IsDevelopment())
{ {

@ -319,7 +319,7 @@ namespace ZKLT.Hadoop
for (var i = 0; i < table.Columns.Length; i++) for (var i = 0; i < table.Columns.Length; i++)
{ {
var _column = table.Columns[i]; var _column = table.Columns[i];
if (row.ContainsKey(_column.Key!)) if (row.ContainsKey(_column.Key!) && row[_column.Key!] != null)
{ {
_colstr.Append($@"`{_column.Key!}`,"); _colstr.Append($@"`{_column.Key!}`,");
_parmstr.Append($@"@{_column.Key},"); _parmstr.Append($@"@{_column.Key},");
@ -405,7 +405,7 @@ namespace ZKLT.Hadoop
for (var i = 0; i < table.Columns.Length; i++) for (var i = 0; i < table.Columns.Length; i++)
{ {
var _column = table.Columns[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!},"); _colstr.Append($@"`{_column.Key!}`=@{_column.Key!},");
_params.Add(_column.Key!, row[_column.Key!]); _params.Add(_column.Key!, row[_column.Key!]);

Loading…
Cancel
Save