You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "g-sun (via GitHub)" <gi...@apache.org> on 2023/06/22 14:14:20 UTC

[GitHub] [doris] g-sun opened a new issue, #21098: [Bug] Power BI连接报错,输入字符串的格式不正确

g-sun opened a new issue, #21098:
URL: https://github.com/apache/doris/issues/21098

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Version
   
   1.2.5
   
   ### What's Wrong?
   
   使用Power BI Desktop 23年5月版+MySQL Connector/NET 8.0.28连接doris服务器,连接时报错,Power BI日志中可以看到
   
   ```
   Message: Input string was not in a correct format.
   StackTrace:
      at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
      at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
      at MySql.Data.MySqlClient.Driver.LoadCharacterSets(MySqlConnection connection)
      at MySql.Data.MySqlClient.Driver.Configure(MySqlConnection connection)
      at MySql.Data.MySqlClient.MySqlConnection.Open()
      at Microsoft.Mashup.Engine1.Library.Common.TracingDbConnection.<Open>b__5_0(IHostTrace trace)
      at Microsoft.Mashup.Engine1.Library.Common.Tracer.<>c__DisplayClass19_0.<TracePerformance>b__0(IHostTrace trace)
      at Microsoft.Mashup.Engine1.Library.Common.Tracer.TracePerformance[T](String method, Func`2 func)
   
   Exception:
   ExceptionType: System.FormatException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
   Message: Input string was not in a correct format.
   StackTrace:
      at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
      at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
      at MySql.Data.MySqlClient.Driver.LoadCharacterSets(MySqlConnection connection)
      at MySql.Data.MySqlClient.Driver.Configure(MySqlConnection connection)
      at MySql.Data.MySqlClient.MySqlConnection.Open()
      at Microsoft.Mashup.Engine1.Library.Common.TracingDbConnection.<Open>b__5_0(IHostTrace trace)
      at Microsoft.Mashup.Engine1.Library.Common.Tracer.<>c__DisplayClass19_0.<TracePerformance>b__0(IHostTrace trace)
      at Microsoft.Mashup.Engine1.Library.Common.Tracer.TracePerformance[T](String method, Func`2 func)
      at Microsoft.Mashup.Engine1.Library.Common.TracingDbConnection.Open()
      at Microsoft.Mashup.Engine1.Library.Common.WrappedDbConnection.Open()
      at Microsoft.Mashup.Engine1.Library.Common.DbExtensions.<>c__DisplayClass0_0.<Open>b__0()
      at Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.RunWithRetryGuard[T](Func`1 action, Func`2 retryAfterSqlError, Action finalizeOnRetry, String dataSourceNameString, IEngineHost host, IResource resource)
      at Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.ConvertDbExceptions[T](IResource resource, Func`1 action, Func`2 retryAfterSqlError, Action finalizeOnRetry, String dataSourceNameString, IEngineHost host)
   ```
   
   
   ### What You Expected?
   
   正常加载数据
   
   ### How to Reproduce?
   
   错误出现在MySQL.Data的Driver.cs,https://github.com/mysql/mysql-connector-net/blob/8.0.28/MySQL.Data/src/Driver.cs#L345
   对autocommit的值Ture进行Convert.ToInt32时出现错误。
   抓包发现返回值是1,但列类型是FIELD_TYPE_TINY,而MySQL对应列类型是FIELD_TYPE_LONGLONG。
   导致这个问题的原因是https://github.com/mysql/mysql-connector-net/blob/8.0.28/MySQL.Data/src/Field.cs#L275。
   
   ### Anything Else?
   
   Driver.cs中相关代码是8.0.27新增,所以这个问题的解决方法有几种:
   1. Doris修改autocommit列类型,这个也符合兼容MySQL协议的思路。
   2. Power BI使用8.0.27以前的mysql client,这个需要微软调整相关文档。但Power BI/MySQL/Doris都在发展,一直使用旧版本不是最好的思路。
   3.  Power BI连接时修改代码增加TreatTinyAsBoolean设置(https://learn.microsoft.com/zh-cn/powerquery-m/mysql-database),但这个需要对M语言有一定的了解才可以,具备这个能力的用户在Power BI用户群中占比很低,也不是很现实。
   
   很希望可以提交PR,但对Doris代码不熟悉,可能无能为力。
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] Zhangyue168 commented on issue #21098: [Bug] Power BI连接报错,输入字符串的格式不正确

Posted by "Zhangyue168 (via GitHub)" <gi...@apache.org>.
Zhangyue168 commented on issue #21098:
URL: https://github.com/apache/doris/issues/21098#issuecomment-1730723649

   谢谢大佬的回复,解决了我现在的问题。采用了的第三种解决方案,数据已成功加载(在Power BI Desktop中)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [I] [Bug] Power BI连接报错,输入字符串的格式不正确 [doris]

Posted by "finovy (via GitHub)" <gi...@apache.org>.
finovy commented on issue #21098:
URL: https://github.com/apache/doris/issues/21098#issuecomment-1855088763

   请教下 Doris修改autocommit列类型 这个如何修改?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org