“无效的 BXL 流"在执行 R 脚本时在 MS-SQL 服务器中 [英] "Invalid BXL stream" in MS-SQL server while executing R scripts

查看:49
本文介绍了“无效的 BXL 流"在执行 R 脚本时在 MS-SQL 服务器中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在执行一个 R 脚本作为 ms-sql 存储过程.我正在尝试使用geosphere"包,但是当我执行存储过程时,我收到错误无效的 BXL 流"并且执行停止.包已经安装在机器上,只是加载包会导致此错误,即 library("geosphere") 导致错误.

I am executing an R script as ms-sql stored procedure. I'm trying to use the "geosphere" package, however when I execute the stored procedure, I'm getting the error "Invalid BXL stream" and the execution halts. The package is already installed on the machine and simply loading the package causes this error i.e library("geosphere") causes the error.

但是,我可以将这个包与 R Studio 独立使用,所以这个包似乎没有任何问题.

I can however, use this package independently with R Studio, so there doesn't seem to be any issue with the package.

推荐答案

我知道这个问题已经过时了,但我多次遇到同样的问题,所以我想在这里留下我的结果.

I know this question is dated but I've run into the same issue multiple times so I wanted to leave my results here.

我在 MS-SQL 2016/17 中使用 sp_execute_external_script 运行 R 和 Python 脚本时发现,BXL 错误有两个不同的原因

What I've found in using sp_execute_external_script to run R and Python scripts in MS-SQL 2016/17 is that the BXL error comes for 2 different reasons

  1. 错误的数据类型 - 通常,SQL 不理解从脚本中发送的数据类型.通常将数据显式转换为特定数据类型会有所帮助.

  1. Bad data types - Often, SQL doesn't understand the data types being sent out of the script. Usually explicitly casting the data as a certain datatype helps here.

错误的包配置 - R 和 Anaconda 发行版中的某些包不能与存储过程很好地同步,因为数据库阻止了这些包中的某些依赖项.尝试在 R 或 Python 的 SQL 安装实例中重新安装包.

Bad package configuration - Certain packages in the R and Anaconda distributions don't sync well with the stored procedure since the database blocks certain dependencies in these packages. Try reinstalling the package in the SQL installed instance of R or Python.

您的问题似乎属于后一类.我希望有帮助!

It seems that your problem falls in the latter category. I hope that helped!

这篇关于“无效的 BXL 流"在执行 R 脚本时在 MS-SQL 服务器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆