{"action":"created","issue":{"url":"https://api.github.com/repos/mcaceresb/stata-parquet/issues/12","repository_url":"https://api.github.com/repos/mcaceresb/stata-parquet","labels_url":"https://api.github.com/repos/mcaceresb/stata-parquet/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/mcaceresb/stata-parquet/issues/12/comments","events_url":"https://api.github.com/repos/mcaceresb/stata-parquet/issues/12/events","html_url":"https://github.com/mcaceresb/stata-parquet/issues/12","id":376259874,"node_id":"MDU6SXNzdWUzNzYyNTk4NzQ=","number":12,"title":"Rewrite in Java?","user":{"login":"kylebarron","id":15164633,"node_id":"MDQ6VXNlcjE1MTY0NjMz","avatar_url":"https://avatars3.githubusercontent.com/u/15164633?v=4","gravatar_id":"","url":"https://api.github.com/users/kylebarron","html_url":"https://github.com/kylebarron","followers_url":"https://api.github.com/users/kylebarron/followers","following_url":"https://api.github.com/users/kylebarron/following{/other_user}","gists_url":"https://api.github.com/users/kylebarron/gists{/gist_id}","starred_url":"https://api.github.com/users/kylebarron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylebarron/subscriptions","organizations_url":"https://api.github.com/users/kylebarron/orgs","repos_url":"https://api.github.com/users/kylebarron/repos","events_url":"https://api.github.com/users/kylebarron/events{/privacy}","received_events_url":"https://api.github.com/users/kylebarron/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":87,"created_at":"2018-11-01T05:34:34Z","updated_at":"2018-11-07T03:54:20Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"It appears that the Java API (at least for Stata 15) is considerably nicer. I just tested it and it appears that Stata will automatically widen string columns when trying to enter wider strings, which would be very helpful.\r\n\r\nIt's definitely worth discussing this before you spend too much time on C++ code. I could try to code up a prototype in Java this weekend.\r\n\r\n- High level overview: https://www.stata.com/new-in-stata/java-plugins/\r\n- Stata Java API: https://www.stata.com/java/api15/\r\n\r\nHere's \"hello world\" code to reproduce:\r\n```java\r\nimport com.stata.sfi.*;\r\npublic class HelloFromJava\r\n{\r\n        public static int sayhello(String[] args)\r\n        {\r\n               SFIToolkit.displayln(\"Hello from java!\") ;\r\n               int var_num = Data.addVarStr(\"str_var\", 2);\r\n               SFIToolkit.displayln(\"Created str var of length 1\") ;\r\n               long obs_num = 1;\r\n               Data.storeStr(1, obs_num, \"a\");\r\n               long obs_num2 = 2;\r\n               Data.storeStr(1, obs_num2, \"abcd\");\r\n               SFIToolkit.displayln(Macro.getGlobal(\"S_MACH\")) ;\r\n               return(0) ;      // Stata return code\r\n        }\r\n}\r\n```\r\n\r\nCompile with (on mac at least):\r\n```bash\r\njavac -classpath sfi-api.jar HelloFromJava.java\r\njar cvf tryjava.jar HelloFromJava.class\r\ncp tryjava.jar ~/Library/Application\\ Support/Stata/ado/personal/t/tryjava.jar\r\n```\r\n\r\nStata program:\r\n```stata\r\nprogram tryjava\r\n       version 15\r\n       clear\r\n       set obs 2\r\n       javacall HelloFromJava sayhello, jar(tryjava.jar)\r\nend\r\n```\r\n\r\nThis gives:\r\n![image](https://user-images.githubusercontent.com/15164633/47834528-3501f400-dd76-11e8-8af5-d1177ed69e86.png)\r\n"},"comment":{"url":"https://api.github.com/repos/mcaceresb/stata-parquet/issues/comments/436496097","html_url":"https://github.com/mcaceresb/stata-parquet/issues/12#issuecomment-436496097","issue_url":"https://api.github.com/repos/mcaceresb/stata-parquet/issues/12","id":436496097,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjQ5NjA5Nw==","user":{"login":"mcaceresb","id":4219197,"node_id":"MDQ6VXNlcjQyMTkxOTc=","avatar_url":"https://avatars0.githubusercontent.com/u/4219197?v=4","gravatar_id":"","url":"https://api.github.com/users/mcaceresb","html_url":"https://github.com/mcaceresb","followers_url":"https://api.github.com/users/mcaceresb/followers","following_url":"https://api.github.com/users/mcaceresb/following{/other_user}","gists_url":"https://api.github.com/users/mcaceresb/gists{/gist_id}","starred_url":"https://api.github.com/users/mcaceresb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcaceresb/subscriptions","organizations_url":"https://api.github.com/users/mcaceresb/orgs","repos_url":"https://api.github.com/users/mcaceresb/repos","events_url":"https://api.github.com/users/mcaceresb/events{/privacy}","received_events_url":"https://api.github.com/users/mcaceresb/received_events","type":"User","site_admin":false},"created_at":"2018-11-07T03:54:20Z","updated_at":"2018-11-07T03:54:20Z","author_association":"OWNER","body":"Very very cool! What's the next step? Write? Or are you going to benchmark it first?"}}
{"actor":{"display_login":"mcaceresb"}}