blob: 2fcf03f86e735c7e17eb2dcdd0d50c4d717c3f1a [file] [log] [blame]
"use strict";(self.webpackChunkdoris_website=self.webpackChunkdoris_website||[]).push([[27173],{15680:(e,n,t)=>{t.d(n,{xA:()=>d,yg:()=>f});var a=t(296540);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function o(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){r(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function i(e,n){if(null==e)return{};var t,a,r=function(e,n){if(null==e)return{};var t,a,r={},s=Object.keys(e);for(a=0;a<s.length;a++)t=s[a],n.indexOf(t)>=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)t=s[a],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var l=a.createContext({}),c=function(e){var n=a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},d=function(e){var n=c(e.components);return a.createElement(l.Provider,{value:n},e.children)},N="mdxType",p={inlineCode:"code",wrapper:function(e){var n=e.children;return a.createElement(a.Fragment,{},n)}},u=a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,s=e.originalType,l=e.parentName,d=i(e,["components","mdxType","originalType","parentName"]),N=c(t),u=r,f=N["".concat(l,".").concat(u)]||N[u]||p[u]||s;return t?a.createElement(f,o(o({ref:n},d),{},{components:t})):a.createElement(f,o({ref:n},d))}));function f(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var s=t.length,o=new Array(s);o[0]=u;var i={};for(var l in n)hasOwnProperty.call(n,l)&&(i[l]=n[l]);i.originalType=e,i[N]="string"==typeof e?e:r,o[1]=i;for(var c=2;c<s;c++)o[c]=t[c];return a.createElement.apply(null,o)}return a.createElement.apply(null,t)}u.displayName="MDXCreateElement"},150477:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>o,default:()=>p,frontMatter:()=>s,metadata:()=>i,toc:()=>c});var a=t(58168),r=(t(296540),t(15680));const s={title:"BACKENDS",language:"en"},o=void 0,i={unversionedId:"sql-manual/sql-functions/table-functions/backends",id:"version-2.0/sql-manual/sql-functions/table-functions/backends",title:"BACKENDS",description:"\x3c!--",source:"@site/versioned_docs/version-2.0/sql-manual/sql-functions/table-functions/backends.md",sourceDirName:"sql-manual/sql-functions/table-functions",slug:"/sql-manual/sql-functions/table-functions/backends",permalink:"/docs/2.0/sql-manual/sql-functions/table-functions/backends",draft:!1,tags:[],version:"2.0",frontMatter:{title:"BACKENDS",language:"en"},sidebar:"docs",previous:{title:"ICEBERG_META",permalink:"/docs/2.0/sql-manual/sql-functions/table-functions/iceberg-meta"},next:{title:"FRONTENDS",permalink:"/docs/2.0/sql-manual/sql-functions/table-functions/frontends"}},l={},c=[{value:"<code>backends</code>",id:"backends",level:2},{value:"Name",id:"name",level:3},{value:"description",id:"description",level:3},{value:"syntax",id:"syntax",level:4},{value:"example",id:"example",level:3},{value:"keywords",id:"keywords",level:3}],d={toc:c},N="wrapper";function p(e){let{components:n,...t}=e;return(0,r.yg)(N,(0,a.A)({},d,t,{components:n,mdxType:"MDXLayout"}),(0,r.yg)("h2",{id:"backends"},(0,r.yg)("inlineCode",{parentName:"h2"},"backends")),(0,r.yg)("h3",{id:"name"},"Name"),(0,r.yg)("version",{since:"dev"},(0,r.yg)("p",null,"backends")),(0,r.yg)("h3",{id:"description"},"description"),(0,r.yg)("p",null,"Table-Value-Function, generate a temporary table named ",(0,r.yg)("inlineCode",{parentName:"p"},"backends"),". This tvf is used to view the information of BE nodes in the doris cluster."),(0,r.yg)("p",null,"This function is used in ",(0,r.yg)("inlineCode",{parentName:"p"},"FROM")," clauses."),(0,r.yg)("h4",{id:"syntax"},"syntax"),(0,r.yg)("p",null,(0,r.yg)("inlineCode",{parentName:"p"},"backends()")),(0,r.yg)("p",null,"The table schema of ",(0,r.yg)("inlineCode",{parentName:"p"},"backends()")," tvf\uff1a"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre"},"mysql> desc function backends();\n+-------------------------+---------+------+-------+---------+-------+\n| Field | Type | Null | Key | Default | Extra |\n+-------------------------+---------+------+-------+---------+-------+\n| BackendId | BIGINT | No | false | NULL | NONE |\n| Host | TEXT | No | false | NULL | NONE |\n| HeartbeatPort | INT | No | false | NULL | NONE |\n| BePort | INT | No | false | NULL | NONE |\n| HttpPort | INT | No | false | NULL | NONE |\n| BrpcPort | INT | No | false | NULL | NONE |\n| LastStartTime | TEXT | No | false | NULL | NONE |\n| LastHeartbeat | TEXT | No | false | NULL | NONE |\n| Alive | BOOLEAN | No | false | NULL | NONE |\n| SystemDecommissioned | BOOLEAN | No | false | NULL | NONE |\n| TabletNum | BIGINT | No | false | NULL | NONE |\n| DataUsedCapacity | BIGINT | No | false | NULL | NONE |\n| AvailCapacity | BIGINT | No | false | NULL | NONE |\n| TotalCapacity | BIGINT | No | false | NULL | NONE |\n| UsedPct | DOUBLE | No | false | NULL | NONE |\n| MaxDiskUsedPct | DOUBLE | No | false | NULL | NONE |\n| RemoteUsedCapacity | BIGINT | No | false | NULL | NONE |\n| Tag | TEXT | No | false | NULL | NONE |\n| ErrMsg | TEXT | No | false | NULL | NONE |\n| Version | TEXT | No | false | NULL | NONE |\n| Status | TEXT | No | false | NULL | NONE |\n| HeartbeatFailureCounter | INT | No | false | NULL | NONE |\n| NodeRole | TEXT | No | false | NULL | NONE |\n+-------------------------+---------+------+-------+---------+-------+\n23 rows in set (0.002 sec)\n")),(0,r.yg)("p",null,"The information displayed by the ",(0,r.yg)("inlineCode",{parentName:"p"},"backends")," tvf is basically consistent with the information displayed by the ",(0,r.yg)("inlineCode",{parentName:"p"},"show backends")," statement. However, the types of each field in the ",(0,r.yg)("inlineCode",{parentName:"p"},"backends")," tvf are more specific, and you can use the ",(0,r.yg)("inlineCode",{parentName:"p"},"backends")," tvf to perform operations such as filtering and joining."),(0,r.yg)("p",null,"The information displayed by the ",(0,r.yg)("inlineCode",{parentName:"p"},"backends")," tvf is authenticated, which is consistent with the behavior of ",(0,r.yg)("inlineCode",{parentName:"p"},"show backends"),", user must have ADMIN/OPERATOR privelege."),(0,r.yg)("h3",{id:"example"},"example"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre"},'mysql> select * from backends()\\G\n*************************** 1. row ***************************\n BackendId: 10002\n Host: 10.xx.xx.90\n HeartbeatPort: 9053\n BePort: 9063\n HttpPort: 8043\n BrpcPort: 8069\n LastStartTime: 2023-06-15 16:51:02\n LastHeartbeat: 2023-06-15 17:09:58\n Alive: 1\n SystemDecommissioned: 0\n TabletNum: 21\n DataUsedCapacity: 0\n AvailCapacity: 5187141550081\n TotalCapacity: 7750977622016\n UsedPct: 33.077583202570978\n MaxDiskUsedPct: 33.077583202583881\n RemoteUsedCapacity: 0\n Tag: {"location" : "default"}\n ErrMsg: \n Version: doris-0.0.0-trunk-4b18cde0c7\n Status: {"lastSuccessReportTabletsTime":"2023-06-15 17:09:02","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}\nHeartbeatFailureCounter: 0\n NodeRole: mix\n1 row in set (0.038 sec)\n')),(0,r.yg)("h3",{id:"keywords"},"keywords"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre"},"backends\n")))}p.isMDXComponent=!0}}]);